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: 

Adding header text to bapi_pr_create is not working?

hiteshbhandari
Explorer
0 Kudos

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

Former Member
0 Kudos

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

Ashg1402
Contributor
0 Kudos

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'.

0 Kudos

No result. Nothing happened.