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: 

print program for the following smartform..

Former Member
0 Kudos

HI..

Iam designing a custom smartform for shipper's instructions for the PO created..

Say if my program is zprogram and smartform is zsmartform and form routine is zroutine can sombebody give me the code for how the print program should look like.. Say the data extraction part for value field is ekpo-netwr for PO and for othercharges field( need to execute FM read_text from terms of delivery text of PO header where lang = EN and object = EKKO )..

Appreciate your help in this regard.. mainly appreciate how the form routine zroutine should be coded..

Thanks,

Kanthi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi kanthi.

To make a routine for printing a smartform you must use the NAST structure. In the OBJKY field is the value for the document you are currently printing. After executing the entire routine you must return ent_retco = sy-subrc. Check the other fields on NAST structure, some of them are usefull to pass print parameters to the smartform.

Hope it helps

Jesus

4 REPLIES 4

Former Member
0 Kudos

Hi kanthi.

To make a routine for printing a smartform you must use the NAST structure. In the OBJKY field is the value for the document you are currently printing. After executing the entire routine you must return ent_retco = sy-subrc. Check the other fields on NAST structure, some of them are usefull to pass print parameters to the smartform.

Hope it helps

Jesus

Former Member
0 Kudos

Hello..

http://searchsap.techtarget.com/loginMembersOnly/1,289498,sid21_gci1116250,00.html?NextURL=http%3A//...

How to find a print program for an SAPscript of a Smart Form

If you're looking to find a print program for an SAPscript of a Smart Form, use se16 to show table TNAPR. It will show you all the information you need to find the print program and the matching form.

0 Kudos

Hi Thanks for the replies..

But this one is a custom print program... and i just need to populate four fields in it and two of the fields are the one i mentioned above..

So can someone put a gneral print program for this custom form for PO creation..( assuming zprogram , zsmartform and zroutine as the ones to be designed)

thanks,

Kanthi

0 Kudos

Hi Kanthi,

Here are the steps while developing custom print program.

1)Cofigure the new custom program, routine and smartform in output determination.

2) Coming to the program this will be executed from the Subroutine which is configured on the output determination.

3) NAST and TNAPR structure are poulated, wher you will get the Object Key, and smart form name.

4) Based on the aende of the nast structure we can know that it is printing first time(NAST-AENDE eq Space) or reprint due to some changes. This field NAST-AENDE is useful for restricting to reprint only for changes in certain fields. In order to restrict reprint we will read the most recent data(DATVR) and time(UHRVR) from table NAST based on the object key and get the change data using the ME_READ_HISTORY, find the required fields went for changes based on PO change log . No required changes found then change the return code to 1 and update error message NAST_PROTOCOL_UPDATE and exit the program.

5) Get the required details based on the object key of NAST and call the Smartform function module.

Regards,

Arun.