Skip to Content

Using Function module BAPI_PR_CREATE Header Text not able to add

hi,

I am facing one problem I am using
CALL FUNCTION 'BAPI_PR_CREATE' For creating Purchase Request,
Everything is correct, But Purchase Header text i am not able to Add it, I have 3 Header texts At Indent ME51n. It only taking only one text for each indent.
If i give at a time 3 texts only last one which means what i passed last in the code it is taking as header text

like in coding.

header text1

header text2

header text3.

It only update Header text3.

IT_HTEXT TYPE BAPIMEREQHEADTEXT OCCURS 0,

The code is like.

IF WA_FINAL1-HTEXT1 IS NOT INITIAL.
WA_HTEXT-TEXT_ID = 'B01'.
WA_HTEXT-TEXT_LINE = WA_FINAL1-HTEXT1.
APPEND WA_HTEXT TO IT_HTEXT.
CLEAR : WA_HTEXT.
ENDIF.

IF WA_FINAL1-HTEXT1 IS NOT INITIAL.
WA_HTEXT-TEXT_ID = 'B02'.
WA_HTEXT-TEXT_LINE = WA_FINAL1-HTEXT1.
APPEND WA_HTEXT TO IT_HTEXT.
CLEAR : WA_HTEXT.
ENDIF.

IF WA_FINAL1-HTEXT1 IS NOT INITIAL.
WA_HTEXT-TEXT_ID = 'B03'.
WA_HTEXT-TEXT_LINE = WA_FINAL1-HTEXT1.
APPEND WA_HTEXT TO IT_HTEXT.
CLEAR : WA_HTEXT.
ENDIF.

All header texts not able to pass.Any suggestions update me, If it is not possible Please provide me Alternatives.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 28, 2017 at 10:34 AM

    Please check SAP-KBA 2075535 "BAPI_PR_CREATE: one header text" for this.

    Extract :

    "Cause
    Even if you are able to define more than one text ID for the Preq, the system can only handle one text on the header level, text id B01, because they are considered internal documents, which does not support the creation of additional header memos.
    In the standard SAP system, entering other header texts alongside the header memos is not supported.

    Resolution
    It is also not possible for online transaction codes. When using transaction ME51N, if you try to insert a test for the second text id, system will clear it out. Only the Header Note B01 will be considered. When using the BAPI, system will concatenate the two text IDs in the B01.
    This functionality was not programmed in the system."

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 28, 2017 at 10:57 AM
    -1

    Hi Kali,

    try to set break point at FM : SAVE_TEXT and check some parameter input to FM, maybe you input wrong some data.

    Thanks,

    John

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 29, 2017 at 04:53 AM
    -1

    Hi kali,

    Try passing the text with the pr item in the structure PRITEMTEXT TYPE BAPIMEREQITEMTEXT.

    Hope it helpful,

    Regards,

    Venkat.

    Add comment
    10|10000 characters needed characters exceeded