Application Development and Automation 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: 
Read only

SAPscript: link to existing element in same window

Joerg_S
Participant
0 Likes
962

Hi,

i'm using standard print programm (SAPM07DR) to print material documents (MIGO).

I allready have defined my element

/E WE3KOPF


and printout is OK.

Problem:
for other type of material print programm (SAPM07DR) is requesting

/E WE3KOPF1



Standard solution would be:
create

/E WE3KOPF1

and copy/paste text from

/E WE3KOPF

into

i don't like that, because in case of changings i have to change twice !!!

So i search for a function which allows me to link to

/E WE3KOPF

like:

-

-


/E WE3KOPF


K1 &H_STRAS&
K1 &H_PSTLZ& &H_ORT01& &H_ORT02&
/*

/E WE3KOPF1

/: link to WE3KOPF <---- ???

does anybody know about such a function?

(i don't want to change/copy standard print program!)

kind regards

Jörg S.

Message was edited by: Jörg S. (i like it bold)

Jörg Sauterleute

6 REPLIES 6
Read only

Former Member
0 Likes
728

Hi,

Try this..

Use the PERFORM STATEMENT in the text element WE3KOPF1..

/E WE3KOPF1

SAPSCRIPT FORM CHANGES

-


/: PERFORM DISPLAY_WE3KOPF1 IN PROGRAM ZREPORT1

............

/: ENDPERFORM.

Report program

-


Create a new report program and have that subroutine here.

FORM DISPLAY_WE3KOPF1 TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

  • CALL THE FUNCTION WRITE_FORM WITH THE TEXT ELEMENT.

ENDFORM.

Thanks,

Naren

Read only

0 Likes
728

Hi Naren,

in Function "WRITE_FORM" there is a certain check:

+function write_form.

data:

create type i,

etype like itcca-tdetype.

check co_perform-active <> true.+ <--- !!! (function was left at this point)

subrc = 0

Looks like SAP avoids your solution ...

kind regards

Jörg

Read only

Clemenss
Active Contributor
0 Likes
728

Hi Jörg,

Hmm. You could try to write an external form and let this form trigger the defined element.

At element WE3KOPF1 add the command lines

/: PERFORM LINK_ELEMENT IN PROGRAM Z_SAPSCRIPT_FORMS

/: USING 'WE3KOPF1'

/: ENDPERFORM

Then create an external formroutine with a function call

CALL FUNCTION 'WRITE_FORM'

...

elem = -value

...

Just an idea - don't know it works. I hope you have minimal experience creating external form for sapscript. If not - it's well-documented at

Calling ABAP Subroutines: PERFORM

Hope it's worth a try.

Regards,

Clemens

Read only

0 Likes
728

Hi Clemens,

see below ...

Read only

Clemenss
Active Contributor
0 Likes
728

Hi Jörg,

sorry and thank you for trying.

No glory gained (:

Regards,

Clemens

Read only

Joerg_S
Participant
0 Likes
728

No Solution found.

Not worth trying any longer...