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: 

&VBAK-BSTNK& is not printing data in form

Former Member
0 Kudos

Hi

I have made some changes SAP script for the SD Invoice to show the Customer Purchase Order by putting a Window in form and the putting above code (&VBAK-BSTNK&) in Symbols and Command but none of them worked.

Do I need do something differnetly? Is there any other way to get customer's PO data details in Invoice?

Thanks for your help.

regards

5 REPLIES 5

former_member555112
Active Contributor
0 Kudos

Hi,

Can you show your piece of code.

Regards,

Ankur Parab

Former Member
0 Kudos

Hi Ankur,

Thanks for your reply.

I have not written any code but only a command to get the field value into the form.

Do I need to write a code to get data into a field?

thanks

0 Kudos

Hi,

reasons for data not displying:

1) check the data in table level for the data ur chking

2)check in the VBAK table for the data verification for tht particular document

3)try to fetch the CPO from the following tables;

VBRK-BSTNK_VF or

VBKD-BSTKD

hope this will help u

regards

PP

Former Member
0 Kudos

Use the the following code to get the data and print is script

Write the below code in script.

PERFORM get_data IN PROGRAM ZTEST

USING &FIELD1&

CHANGING &FIELD2&

ENDPERFORM

write the value of FIELD2.

write the below code in program ZTEST

FORM get_data TABLES l_input_table STRUCTURE itcsy (table to hold the values passed from script)

l_output_table STRUCTURE itcsy.(table to hold the values passed to script)

READ TABLE l_input_table WITH KEY name = 'FIELD1' (should be in same case as used in script).

IF sy-subrc = 0.

l_data = l_input_table-value.

ENDIF.

write ur logic to fetch data

CLEAR l_output_table.

READ TABLE l_output_table WITH KEY name = 'FIELD2'.

IF sy-subrc = 0.

ENDIF.

ENDFORM.

Former Member
0 Kudos

Hello Vikrant,

You can call a new report from within your script and fetch the data needed without making changes to the Driver Program.

In SAPscript add this code just before the place where you need to display your PO details.

/* Call the routine

/: PERFORM FETCH_TABLE_DATA IN PROGRAM Z_SUBROUTINE_POOL

/: USING &INVAR1&

/: CHANGING &OUTVAR1&

/: ENDPERFORM

Now create a report named Z_SUBROUTINE_POOL

-


REPORT Z_SUBROUTINE_POOL.

FORM fetch_table_data TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

<here fetch the data based on in_tab data and poppulate out_tab data>

<out_tab dat would be available in your SAPscript in OUTVAR1 which you can display>

ENDFORM.

Hope this gives you some idea.

Cheers,

Suvendu