Application Development 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: 

Item text is not updating

Former Member
0 Kudos

Dear Friends,

I am using BAPI_GOODSMVT_CREATE, there I am passing item text(sgtxt) to GOODSMVT_ITEM-ITEM_TEXT. But this field is not getting updated in MSEG.

What could be the reasons?

Regards,

Bhavin

17 REPLIES 17

Former Member
0 Kudos

is this GOODSMVT_ITEM in import or export....This should be in import of user exit as it should update in SAP...

0 Kudos

Dear Ramesh,

I am using BAPI seperately in my Z report. Its for uploading opening stock.

Former Member
0 Kudos

Hello,

Try to commit afer you call the FM.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Greetings,

Gabriel

Former Member
0 Kudos

Hi Bhavin

I guess i was wrong...

SORRY.

Kind Regards

Eswar

Message was edited by:

Eswar Rao Boddeti

0 Kudos

Using * is not working.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = WA_GOODSMVT_HEADER

GOODSMVT_CODE = WA_GOODSMVT_CODE

IMPORTING

MATERIALDOCUMENT = LOC_MATERIALDOCUMENT

MATDOCUMENTYEAR = LOC_MATDOCUMENTYEAR

TABLES

GOODSMVT_ITEM = INT_GOODSMVT_ITEM[]

RETURN = INT_RET_CH3[].

I am simply using this code in my program.

Other than Item_text all things are updating fine. I am on ECC6.0

0 Kudos

HI Bhavin

I have manullay tried to post a material document via BAPI: BAPI_GOODSMVT_CREATE with item text and i am successful to add text in material document.

Can you post your code where you populate the data before passing to the FM???

Kind Regards

Eswar

0 Kudos

LOOP AT ITAB.

V_COUNTER = V_COUNTER + 1.

WA_GOODSMVT_CODE-GM_CODE = '05'.

WA_GOODSMVT_HEADER-PSTNG_DATE = ITAB-BUDAT.

WA_GOODSMVT_HEADER-DOC_DATE = ITAB-BLDAT.

WA_GOODSMVT_HEADER-HEADER_TXT = ITAB-BKTXT.

APPEND WA_GOODSMVT_HEADER.

INT_GOODSMVT_ITEM-MATERIAL = ITAB-MATNR.

INT_GOODSMVT_ITEM-PLANT = ITAB-WERKS.

INT_GOODSMVT_ITEM-STGE_LOC = ITAB-LGORT.

INT_GOODSMVT_ITEM-BATCH = ITAB-CHARG.

INT_GOODSMVT_ITEM-MOVE_TYPE = ITAB-BWART.

INT_GOODSMVT_ITEM-ENTRY_QNT = ITAB-ERFMG.

INT_GOODSMVT_ITEM-WITHDRAWN = 'X'.

INT_GOODSMVT_ITEM-AMOUNT_LC = ITAB-EXBWR.

INT_GOODSMVT_ITEM-PROD_DATE = ITAB-HSDAT1.

INT_GOODSMVT_ITEM-ITEM_TEXT = ITAB-SGTXT.

IF ITAB-SP_ST IS NOT INITIAL.

INT_GOODSMVT_ITEM-SPEC_STOCK = ITAB-SP_ST.

INT_GOODSMVT_ITEM-VENDOR = ITAB-LIFNR.

ENDIF.

APPEND INT_GOODSMVT_ITEM.

CLEAR: INT_GOODSMVT_ITEM.

CONCATENATE LOC_MATERIALDOCUMENT 'Document Generated' INTO V_TEXT SEPARATED BY SPACE.

CALL FUNCTION 'ISPAM_SHOW_INDICATOR'

EXPORTING

TEXT = V_TEXT

SHOW = 'X'.

CLEAR: LOC_MATERIALDOCUMENT.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = WA_GOODSMVT_HEADER

GOODSMVT_CODE = WA_GOODSMVT_CODE

IMPORTING

MATERIALDOCUMENT = LOC_MATERIALDOCUMENT

MATDOCUMENTYEAR = LOC_MATDOCUMENTYEAR

TABLES

GOODSMVT_ITEM = INT_GOODSMVT_ITEM[]

RETURN = INT_RET_CH3[].

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

IF LOC_MATERIALDOCUMENT IS NOT INITIAL.

ITAB1-MBLNR = LOC_MATERIALDOCUMENT.

MOVE-CORRESPONDING ITAB TO ITAB1.

APPEND ITAB1.

CLEAR: ITAB1.

ENDIF.

LOOP AT INT_RET_CH3.

AT FIRST.

ULINE.

ENDAT.

WRITE: 'Error in Record', V_COUNTER.

WRITE: / INT_RET_CH3-MESSAGE.

CLEAR: INT_RET_CH3.

ENDLOOP.

REFRESH: INT_GOODSMVT_ITEM, WA_GOODSMVT_HEADER,

INT_RET_CH3.

CLEAR: ITAB, INT_GOODSMVT_ITEM,

WA_GOODSMVT_HEADER, WA_GOODSMVT_CODE,

LOC_MATDOCUMENTYEAR.

ENDLOOP.

0 Kudos

HI Bhavin

I could successfully add text for item when posting material documents with the below code, please check...

PARAMETERS: P_MATNR TYPE MATNR OBLIGATORY,
            P_WERKS TYPE WERKS_D OBLIGATORY,
            P_LGORT TYPE LGORT_D OBLIGATORY.
DATA: GS_HEADER   TYPE  BAPI2017_GM_HEAD_01,
      GS_MVT      TYPE  BAPI2017_GM_CODE,
      G_MAT_DOC   TYPE  BAPI2017_GM_HEAD_RET-MAT_DOC,
      G_MAT_YEAR  TYPE  BAPI2017_GM_HEAD_RET-DOC_YEAR,
      GT_ITEM     TYPE  TABLE OF BAPI2017_GM_ITEM_CREATE,
      WA_ITEM     TYPE  BAPI2017_GM_ITEM_CREATE,
      GT_RET      TYPE  TABLE OF BAPIRET2,
      WA_RET      TYPE  BAPIRET2.

MOVE SY-DATUM TO: GS_HEADER-PSTNG_DATE,
                  GS_HEADER-DOC_DATE.
MOVE '05' TO GS_MVT-GM_CODE.

WA_ITEM-MATERIAL  = P_MATNR.
WA_ITEM-PLANT     = P_WERKS.
WA_ITEM-STGE_LOC  = P_LGORT.
WA_ITEM-MOVE_TYPE = '561'.
WA_ITEM-ENTRY_QNT = 10.
WA_ITEM-ENTRY_UOM = 'PC'.
WA_ITEM-ITEM_TEXT = 'TESTING TEXTS'.
APPEND WA_ITEM TO GT_ITEM.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
  EXPORTING
    GOODSMVT_HEADER             = GS_HEADER
    GOODSMVT_CODE               = GS_MVT
*   TESTRUN                     = ' '
 IMPORTING
*   GOODSMVT_HEADRET            =
   MATERIALDOCUMENT            = G_MAT_DOC
   MATDOCUMENTYEAR             = G_MAT_YEAR
  TABLES
    GOODSMVT_ITEM               = GT_ITEM
*   GOODSMVT_SERIALNUMBER       =
    RETURN                      = GT_RET.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .

Use the above code in a temporary program for the material, plant and st.loc combination you are using and check if you can populate the items texts???

Kind Regards

Eswar

0 Kudos

Not working. I think some problem with Standard BAPI. what do you suggest. I am using ECC6.0. May be bug ???

0 Kudos

You mean didnt work even with my code???

Can you try creating a material document online and check???

Kind Regards

Eswar

0 Kudos

Yes I have tested for your code too.

Thru Transaction its working. But through BAPI Not working.

0 Kudos

Can you place a break-point at line 362 in FM: MAP2I_B2017_GM_ITEM_TO_IMSEG and execute the code i have provided.

Check if you can reach the break-point and ITEM_TEXT is transferred...

Regards

Eswar

0 Kudos

Yes Populating Value in field you have suggested

0 Kudos

Hi everybody:

I have the same question.

I can't find the ITEM_TEXT from MSEG, Why?

should I set other parameter?

I am SURE that field of ITEM_TEXT is not empty,

before the Program call Function 'BAPI_TRANSACTION_COMMIT',

It's gone. Can anybody help me? ...it's hurry....

Thanks!

0 Kudos

provide my code..

  • Part of Commit Work

call function 'BAPI_GOODSMVT_CREATE'

exporting

goodsmvt_header = bapi_header

goodsmvt_code = bapi_code

importing

goodsmvt_headret = bapi_headret

materialdocument = bapi_matdoc

matdocumentyear = bapi_docyear

tables

goodsmvt_item = bapi_item

goodsmvt_serialnumber = bapi_sn

return = bapi_ret.

  • Part of BAPI ITEM input..

bapi_item-material = itab-matnr.

bapi_item-plant = itab-werks.

bapi_item-stge_loc = '0008'.

bapi_item-batch = itab-charg.

bapi_item-move_type = '101'.

bapi_item-stck_type = ' '.

bapi_item-entry_qnt = itab-fkimg.

bapi_item-po_number = itab-ebeln.

bapi_item-po_item = itab-ebelp.

bapi_item-mvt_ind = 'B'.

bapi_item-item_text = itab-bezei. <b><-- it's item text I want filled</b>

append bapi_item.

I don't know what's going on

please help to check it. Thanks...

Former Member

Check if you're using enhancement MBCF0002 (include ZXMBCU02). In this case you MUST fill the export parameter E_SGTXT with the value you want (or I_MSEG-SGTXT). If you don't do this, the item text is cleared.

Regards,

Luís Silva

0 Kudos

Great Answer