cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion sapscript to smartform

Former Member
0 Kudos

Hi,

I have managed to convert my sapscript to smartfiorm, but my question is about the print program of the sapscript.

Is it possible to convert it also or i must to change it maually??

If i must to change manually, what kind of change are to be done to convert this print program??

I have cheched the other thread but no really answer of this question.

Tanks a lot

Accepted Solutions (1)

Accepted Solutions (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Framing the print program for smartform is easy.

Just copy the function module once you generated the smartform.

Paste the fm name in pattern in ABAP editor.

Pass the necessary parameters to it.

Activate it.

Check this link for sample program.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501...

Former Member
0 Kudos

Tanks for your response.

I found the function module name (a name like /1BCDWB/SF00000050). Is it well this kind of fm that you mean.

"Paste the fm name in pattern in ABAP editor."

What would you like to mean with this sentence. Create a new Zprogram and call this fm or create a pattern in my print program of the sapscript.

because when i created a pattern, it must be under 100 lines of code and the fm is longer than that.

Thanks

Former Member
0 Kudos

Hi,

u have to make a few changes in ur smartform print program yar. u need not to change the whole code but replace the statements of start_form,open_form,write_form,end_form,close_form. by the following code.

u have used following stmt.

CALL FUNCTION '/1BCDWB/SF00000001'

but replace it by following code.

DATA: gv_fm_name TYPE rs38l_fnam, "DV1K909057 PRASADDX

gv_formname TYPE tdsfname. "DV1K909057 PRASADDX

  • Calling the layout set

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = gv_formname

IMPORTING

fm_name = gv_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

PERFORM protocol_update.

ENDIF.

IF gv_fm_name IS NOT INITIAL.

  • Below function module is used to show the Smart form

CALL FUNCTION gv_fm_name

also understand the concept by checking the following link.hope this works helpful

Message was edited by:

Durgaprasad Kare

Former Member
0 Kudos

Thanks

My print program is quite long (2000 line) and i found start_form,open_form,write_form,end_form or close_form many times.

A write_form per element.

So i suppose that i must replace all of these by the below code one time at the beginning of the programm?

Is it not more easy for me to just call the smartform from the print rpogramm and do the code on the initilization tab of the smartform?

Just a last question, if I do that what about the information pass betwwen sap,printprogram and smartfornm. Information ; My smartform is the outpout document of the shippment number... Resume :How I can retrieve the information about the shippment??

Thanks a lot to all

Former Member
0 Kudos

i understand that bu the logic u use here is we dont require all the includes of the print program.jst copy the print program to a Z program and only use the top include where all the tables are declared and then use two custom includes for calling the smart form and updating the nast function protocol update.

rest u can delete it .

ur smartform will retrieve data from print program using DOC and NAST.

Former Member
0 Kudos

Yeah it seems im good way now....

Last question about the protocol_update and updating the nast function protocol update

u put in your first message

PERFORM protocol_update. Is that this function you will refered???

What kind of abap code should i out to this perform???

Thanks Kare

Former Member
0 Kudos

this is the include

INCLUDE zme_print_forms. "Custom include to achieve the requirement

inside the include write the following code.

CHECK xscreen = space.

  • Call Function for Protocol Update

CALL FUNCTION 'NAST_PROTOCOL_UPDATE'

EXPORTING

msg_arbgb = syst-msgid

msg_nr = syst-msgno

msg_ty = syst-msgty

msg_v1 = syst-msgv1

msg_v2 = syst-msgv2

msg_v3 = syst-msgv3

msg_v4 = syst-msgv4

EXCEPTIONS

MESSAGE_TYPE_NOT_VALID = 1

NO_SY_MESSAGE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

hope this is helpful

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello, I thought I would use this thread instead of starting my own. I am looking for a pdf document on converting sapscript to smartforms. I found it doing a forum search but I can't find it again. It was hosted by another site and it was 11 pages long. I believe it dealt with the print program (that's what I'm having trouble with).

Regards,

Davis

Former Member
0 Kudos

Hi davis,

rather than that

it simple and purely based on requirement.

using migrate options of smartform initial screen u can migrate from script to smartform.

there on it is very simple.

Former Member
0 Kudos

I did the conversion but I needed help with the print program. The pdf I saw looked like it helped you out with the print program. When I tried to print it my system locked up and I lost the pdf. Thanks for the tip though.