04-28-2017 11:15 AM
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.
04-28-2017 11: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."
04-28-2017 11:56 AM
hi, thanks for you reply.
Solution i did not understood.What i understood is, I has to enter either 1 or 2 or 3.
Only one should be inserted.
I tried, any one it is taking. But not multiple.
04-28-2017 12:23 PM
This means that the BAPI can not do more than what you can do via SAP Enjoy transaction.
Please try to add Multiple HeaderTexts in your PR via trx. "ME51N" ... Then the following behaviour should occur, mentioned in the KBA :
"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"
04-28-2017 2:15 PM
Did some tests myself and indeed :
IF WA_FINAL1-HTEXT1 IS NOT INITIAL.
WA_HTEXT-TEXT_ID = 'B01'. "Won't be used, only the ID of LAST RECORD of HDRTXT-Table!
WA_HTEXT-TEXT_FORM = '/'. "SET AS A NEW LINE
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'. "LAST RECORD HDRTXT-Table => ALL RECORDS added with this ID
WA_HTEXT-TEXT_FORM = '/'. "SET AS A NEW LINE
WA_HTEXT-TEXT_LINE = WA_FINAL1-HTEXT1.
APPEND WA_HTEXT TO IT_HTEXT.
CLEAR : WA_HTEXT.
ENDIF.
That is how it worked in my system ...?
04-29-2017 5:30 AM
I passed the data like above,
Still same problem only B02 is adding i mean last one it is updating the text.
Can i use any Save_text function module
04-28-2017 11:57 AM
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
04-28-2017 11:59 AM
No no lot of posts are available, Like above problem, But no solution for above one.
Default behavior is like this, as per my knowledge.
04-28-2017 12:07 PM
Did you debug as i suggest ? and no error return after call FM save_text ?
Also call bapi commit if you are missing
04-28-2017 12:27 PM
04-29-2017 5:53 AM
Hi kali,
Try passing the text with the pr item in the structure PRITEMTEXT TYPE BAPIMEREQITEMTEXT.
Hope it helpful,
Regards,
Venkat.
04-29-2017 6:04 AM
I need at header not item level, Item level working fine. Ok correct me anything is wrong.