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

Adding header text to bapi_pr_create is not working?

Former Member
0 Likes
1,194

I am using bapi_pr_create for creating a program that create Purchase requisition. What I want is to add header text to be added to newly created PR. I am using following snippet to upload the header text to the program.

prheadertext-preq_item = line_item.

prheadertext-text_id = 'B01'.

prheadertext-text_form = 'EN'.

prheadertext-text_line = 'test line'.

append prheadertext.

clear prheadertext.

.

.

.

.

CALL FUNCTION 'BAPI_PR_CREATE'

   EXPORTING

   prheader   = zprheader

   prheaderx  = zprheaderx

   testrun    = ''

   IMPORTING

     number                       = result

*   PRHEADEREXP                  =

  TABLES

    return     return

    pritem     pritem

   pritemx     pritemx

   pritemtext  = pritemtext .

   prheadertext = prheadertext.




But the above method is not working.

Please suggest.

Hitesh.

3 REPLIES 3
Read only

Former Member
0 Likes
885

Have you tried creating the Header text separately right after creating PR? Check CREATE_TEXT or SAVE_TEXT.

Read only

Ashg1402
Contributor
0 Likes
885

Hi,

Try this -

prheadertext-preq_item = line_item.   (What is the value of this line_item field, I didn't pass this in my value                                                                            to this preq_item field )

prheadertext-text_id = '01'.

prheadertext-text_form = '*'.

prheadertext-text_line = 'test line'.

Read only

Former Member
0 Likes
885

No result. Nothing happened.