Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8088

Re: I have a requirement to auto populate the cost center in ME51N when the user enters the Requisition ID. I could not find any relevant BAdis for this. Can anyone please help?

$
0
0

Importing parameter of this BADI method is an ABAP Object (Class/interface). If you need to update any values, you can respective methods...

 

 

Below is the sample code from the link which I shared...It calls GET_DATA method for getting the current line item data and changes the work area and sets back to buffer using SET_DATA method.....

 

      CLEAR: LS_ITEM_DATA.

      LS_ITEM_DATA = IM_ITEM->GET_DATA( ).

      MOVELS_ITEM_DATA-ERNAM TOLS_ITEM_DATA-AFNAM.

**Get source of supply details

      CLEAR: LS_SOURCE.

      LC_SOURCE = IM_ITEM->GET_SOURCE_OF_SUPPLY( ).

      LT_SOURCE = LC_SOURCE->UPDATE( IM_NOMEI   = 'X').

      DESCRIBETABLELT_SOURCE LINESLV_SOURCE_N.

      IFLV_SOURCE_N EQ1.          "Assign the default data otherwise populate the list"

        READTABLELT_SOURCE ASSIGNING<FS_SOURCE> INDEX1.

        IFSY-SUBRC EQ0.

          LS_SOURCE ?= <FS_SOURCE>.

          LS_SOURCE_DATA = LS_SOURCE->GET_DATA( ).

          MOVE-CORRESPONDINGLS_SOURCE_DATA TOLS_ITEM_DATA.

        ENDIF.

      ENDIF.

      IM_ITEM->SET_DATA(

        EXPORTING

          IM_DATA = LS_ITEM_DATA ).


Viewing all articles
Browse latest Browse all 8088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>