Posts

Passing custom field values to the accounting document during GR/Invoice posting.

Image
Step 1: Create an FM with parameters and table structures similar to the example below. Step 2: Implement the code as shown below and active. DATA : l_f_ebeln TYPE ebeln .    READ TABLE t_accit INTO DATA ( lr_accit ) INDEX 1 .    IF sy - subrc = 0 .     l_f_ebeln = lr_accit - ebeln .    ENDIF .    IF l_f_ebeln IS NOT INITIAL .      SELECT ebeln , ebelp , zz_prd_code , zz_veh_type        FROM ekpo INTO TABLE       @DATA ( lt_ekpo )        WHERE ebeln EQ @l_f_ebeln .    ENDIF .    IF lt_ekpo IS NOT INITIAL .      LOOP AT t_accit INTO DATA ( lr_accit1 ) WHERE koart = 'S' .        READ TABLE lt_ekpo INTO DATA ( lr_ekpo ) WITH KEY ebelp = lr_accit1 - ebelp .        IF sy - subrc = 0 .       ...

Function module to get the Option codes(Characteristic values) in Sale order.

Image
          REQ : Fetch Option codes(characteristic values) in sale order. Step 1:   Pass Sale order in VBAP and get the cuobj. Step 2:   Pass cuobj in FM : VC_I_GET_CONFIGURATION to  INSTANCE  and get configuration values.          *  In this configuration table we have option codes. *************************** * ** Thank you ************************* * * * * **

Dynamic field assignment in SAP ABAP

Image
Req: I have 48 fields in Structure i need to update the field values without using manual assignment.          * I have data in  g_t_config_out internal table. I have Option like below up to OPT48.                Refer:   Sales Order Characteristic update DATA :  lv_idx    TYPE  i ,       lv_field  TYPE  string . LOOP  AT  g_t_config_out  ASSIGNING  FIELD - SYMBOL ( <fs_conf> ) .       lv_idx  =  sy - tabix .       lv_field  =  |OPT{ lv_idx }| .         ASSIGN  COMPONENT  lv_field  OF  STRUCTURE  g_r_hist_giso                        TO  FIELD - SYMBOL ( <fs_opt> ) .        IF  ...

Sales Order Characteristic update

Image
Step 1:   Create a Class.               * Run the T-code SE24.               * Give the class name and click on create. Give description and click on save. Step 2:   Create a Structure with following fields .               * Run the T-code SE11.               * Select data type and give structure name.               * Click on create and select structure.               * Give the description and fields. Step 3:   Create a table type.                                * Run the T-code SE11.             * Select data type and give table type name.             * Click on...