Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM which updates MSEG table from tcode MB1B

Former Member
0 Likes
1,935

Dear Consultants,

I have a requirement where i need to update a custom field in MSEG table with a custom field value from MB1B. I have to perform an enhancement for this, but the problem is am not able to get the appropriate Function Module which updates MSEG table from MB1B. I performed debugging to find out where the updating happens but i couldn't get it. Can u people give your suggestions and guide me, points will be rewarded though. Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,424

Thank you chaitanya mittapally and Tee Gee for your inputs.

But i used a different way i used the concepts of SUBMIT program & EXPORT/IMPORT memory, wrote a custom program to add the data to the custom field i had created earlier in MSEG table after importing the XMSEG internal table from Std. Program (from the last PERFORM sub-routine). After exported back to the std. program. Now my custom field's data sits in MSEG table with out any problem.

Dear Consultants,

I have a requirement where i need to update a custom field in MSEG table with a custom field value from MB1B. I have to perform an enhancement for this, but the problem is am not able to get the appropriate Function Module which updates MSEG table from MB1B. I performed debugging to find out where the updating happens but i couldn't get it. Can u people give your suggestions and guide me, points will be rewarded though. Thank you.

3 REPLIES 3
Read only

Former Member
0 Likes
1,424

Hi Uma shankar,

Try using MB_CREATE_GOODS_MOVEMENT function module.

Thanks & Regards

Chaitanya M

Read only

0 Likes
1,424

Use BAPI -  BAPI_GOODSMVT_CREATE

refer the code below

LW_GOODS_HEADER-PSTNG_DATE    =   SY-DATUM.

LW_GOODS_HEADER-DOC_DATE      =   SY-DATUM.

LW_GOODS_CODE-GM_CODE         =   '04'.

LW_GOODS_ITEM-MATERIAL        =    MATNR .

LW_GOODS_ITEM-PLANT           =    WERKS

LW_GOODS_ITEM-STGE_LOC        =   LGORT.

LW_GOODS_ITEM-BATCH           =   CHARG.

LW_GOODS_ITEM-MOVE_TYPE       =  BWART

LW_GOODS_ITEM-SPEC_STOCK      =   'E'.

LW_GOODS_ITEM-SALES_ORD       =   TARGET VBELN

LW_GOODS_ITEM-S_ORD_ITEM      =   TARGET POSNR

LW_GOODS_ITEM-VAL_SALES_ORD   =   SOURCE-VBELN.

LW_GOODS_ITEM-VAL_S_ORD_ITEM  =   SOURCE-POSNR.

LW_GOODS_ITEM-ENTRY_QNT       =   MENGE.

LW_GOODS_ITEM-ENTRY_UOM       MEINS.

APPEND LW_GOODS_ITEM TO LT_GOODS_ITEM.

           

*-----------------------------------------------------------------------------------------------------------

       CALL FUNCTION 'BAPI_GOODSMVT_CREATE'           

         EXPORTING

           GOODSMVT_HEADER  = LW_GOODS_HEADER

           GOODSMVT_CODE    = LW_GOODS_CODE

         IMPORTING

           MATERIALDOCUMENT = V_MATDOC

         TABLES

           GOODSMVT_ITEM    = LT_GOODS_ITEM

           RETURN           = LT_RETURN1.


Hope this helps

Read only

Former Member
0 Likes
1,425

Thank you chaitanya mittapally and Tee Gee for your inputs.

But i used a different way i used the concepts of SUBMIT program & EXPORT/IMPORT memory, wrote a custom program to add the data to the custom field i had created earlier in MSEG table after importing the XMSEG internal table from Std. Program (from the last PERFORM sub-routine). After exported back to the std. program. Now my custom field's data sits in MSEG table with out any problem.