How to Get Component List of Structure Dynamically

The code below will be enough to get components of a/dynamic structure. I used field symbol in my example, if the structure’s name is known it can be given to the “describe_by_data” method directy.      DATA: ls_comp TYPE abap_componentdescr, ls_stru TYPE REF TO cl_abap_structdescr, lt_comp TYPE STANDARD TABLE OF abap_componentdescr WITH KEY name. FIELD-SYMBOLS: <lfs_first>. ***Assign field symbol here ls_stru ?= cl_abap_typedesc
Read More »

Add Custom Tab to VL02N, VL03N

LE_SHP_TAB_CUST_HEAD Badi should be used to add custom tab to VL02N VL03N. Lets see the steps to add custom tab one by one. Append your structure to LIKP table. With se18 t-code, if doesn’t exist you should create an enhancement implementation. I have already created one and i can see with display option. Double click on implementation name. Create  a function group and define the variables in its TOP include(LZXXTOP) .  TABLES : zzsdappend_likp."(You can also de
Read More »

For All Entries Statement With Key Fields

For all entries statement does not bring “all entries” everytime. To get all data in tables, key fields must be used in select statement. You can see the differences between 2 select statements. The one  that without key fields returns 11 records, the one that with key fields returns 194 records even where conditions are the same.  VBAP is the sales order item table which has sales order number and sales order item number as key fields. When we didn’t use key fields (
Read More »

How To Format Cell Color in BSP

It is quite simple to color cells in a BSP table using getter methods to achive a better look We start by generating the GET_P method of the attribute that we want to color conditionally   Then in the getter method, we use find method of the collection wrapper to determine current table line Next we set the value of the returning parameter under the condition(s) we provide and we are done METHOD GET_P_PARTNER_SERV. DATA: lr_collection TYPE REF TO cl_bsp_wd_collection
Read More »

How To Copy Document With CRM Actions

Here is a simple code to demonstrate how to copy a document using CRM actions. In the action method we implemented, we first declare the variables we are going to use DATA: lc_action_execute TYPE REF TO cl_action_execute. DATA: lv_guid_ref TYPE crmt_object_guid, lv_actionname TYPE ppfdtt, lv_actiontext TYPE ppfdttt.   Next we get the information of the reference document using action object CREATE OBJECT lc_action_execute. * g
Read More »

How To change order status with bol programming

DATA: lv_status TYPE j_estat, lr_adm_h TYPE REF TO cl_crm_bol_entity, lr_btorder TYPE REF TO cl_crm_bol_entity, lr_core TYPE REF TO cl_crm_bol_core, lr_status_h TYPE REF TO cl_crm_bol_entity, lr_status TYPE REF TO cl_crm_bol_entity. lr_core = cl_crm_bol_core=>get_instance( ). CHECK lr_core IS BOUND. lr_core->load_component_set( 'ALL' ). lr_btorder = lr_core->get_root_entity( iv_object_name = '
Read More »

How To Mark Business Partner For Deletion with BUPA_CENTRAL_CHANGE

In order to mark a business partner for deletion, the BUPA_CENTRAL_CHANGE BAPI is used Simply provide the necessarry variables and call the BAPI DATA: lt_return TYPE STANDARD TABLE OF bapiret2, ls_data TYPE bapibus1006_central, ls_datax TYPE bapibus1006_central_x. ls_data-centralarchivingflag = 'X'. ls_datax-centralarchivingflag = 'X'. CALL FUNCTION 'BUPA_CENTRAL_CHANGE' EXPORTING iv_partner = iv_partner is_data = ls_data is_data_x
Read More »

How To Delete Items of CRM Order with CRM_ORDER_MAINTAIN

We start with defining the variables we are going to use for the CRM_ORDER_MAINTAIN function CONSTANTS: lc_mode_delete TYPE crmt_mode VALUE 'D', lc_object_kind_item TYPE crmt_object_kind VALUE 'B'. DATA: lt_header_guid TYPE crmt_object_guid_tab, lt_saved_objects TYPE crmt_return_objects, lt_exception TYPE crmt_exception_t, lv_log_handle TYPE balloghndl, lt_orderadm_i TYPE crmt_orderadm_i_wrkt, ls_orderadm_i
Read More »