cancel
Showing results for 
Search instead for 
Did you mean: 

Print Program variables not identifiable in Sap script

Former Member
0 Kudos

Hi,

I am printing a sap script layout when I save a purchase order (ME22N) .

I have created my own print program and i retrieve the purchase order details with BAPI_PO_GET_DETAILS.

I pass all the values to the Write_form. But None of the variables declared in teh program is Not identifiable in sap script.

I have confirgured the Print program , Form routine ans Sap script name in NACE.

What could be the reason?

An example line from the script:

Script:

INFO1: ( window name)

<S>Delivery Date</>&W_DELIVERYDT&

All the variable W_DELIVERYDT is not identifiable by sap script.

Its same in all windows and with all variables used

Print Program:

SELECT SINGLE eindt

FROM eket

INTO w_deliverydt

WHERE ebeln = ws_po_header1-po_number

AND ebelp = '00010'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = pl_element

function = 'SET'

type = 'BODY'

window = 'INFO1'

  • IMPORTING

Accepted Solutions (0)

Answers (3)

Answers (3)

aidan_black
Active Contributor
0 Kudos

Hi Santhosh,

Can you check if the code correction of this SAP Note resolves this problem:

1243485 - Unprinted variables and lines of a SAPscript form

Regards,

Aidan

Former Member
0 Kudos

Hi

Do not pass hard Coded values like '0010' instead pass the BAPI returned values - PO_HEADER_TEXTS-PO_NUMBER

PO_ITEMS-PO_IT..

and call those values in the Script and also Activate the Debuggger and see what values are coming into the Script.

and see that the strutures that you pass to BAPI are declared Global or not so that they are visible in Script

and try to use CONV * exists if it is something to do with internal and extranal formats..

surya

Former Member
0 Kudos

Yes I checked. All variabes are global.

I had one clue.

I created a selection screen parameter and passed ebeln in s_ebeln and executed. Now the values/variables used in teh print program is identified by script and comming in output.

The thing is , If my print program is triggered from standard ME* transactions, my global variables in the print program are not recoginized by the script. Strange...

Actually For purchase order, there is standard MEDRUCK print program. I did not made copy of that since it is very huge wih spots, etc.

So I created my own Print program and used BAPI to retrive PO details ..and so on..

So what could bethe problem

awin_prabhu
Active Contributor
0 Kudos

Hi Santhosh,

Pls check whether u have assigned ur Print program, Form Routine & Form in NACE transaction to your output type.

former_member242255
Active Contributor
0 Kudos

Check the element names in the print program and also the script.

as you have created your own print program,you may be missing some element names..

Former Member
0 Kudos

Yes I checked the element names, Its right.

When I execute in ME22N , no fields displayed.

But when I execute through ME9F , The ONLY standard structures used from the print program is printing in the script, like nast, ekko. Not not my global decalred fields.

&nast-objky(10)&

&EKKO-EBELN&

In ME22N, nothing gets printed including above two fields. Its strange

nabheetscn
Active Contributor
0 Kudos

Hello

How have you declared you variables it should be in the top not in the sub routine.

Nabheet