2015 Sep 03 9:08 AM
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.
2015 Sep 09 4:37 AM
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.
2015 Sep 03 12:32 PM
Hi Uma shankar,
Try using MB_CREATE_GOODS_MOVEMENT function module.
Thanks & Regards
Chaitanya M
2015 Sep 04 12:50 AM
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
2015 Sep 09 4:37 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |