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

Modifying a Std Script

kiran_k8
Active Contributor
0 Likes
693

Hi Folks,

I am planning to modify a standard script not in terms of windows or logo but in terms of the kind of data it should display in the form.

Can anyone please let me know how to go ahead with such a case.I know that we need to that by defining a perform in the change editor of the particular window and ITCSY structure.

But the problem is I know theotrically but not practically.Can anyone here kindly help me in this regard step by step.

Will be given points for sure.

K.Kiran.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675

hi

good

you can copy the standard driver program to the Z* program and try to do the changes a sper your requrirements.

Thanks

mrutyun^

6 REPLIES 6
Read only

Former Member
0 Likes
676

hi

good

you can copy the standard driver program to the Z* program and try to do the changes a sper your requrirements.

Thanks

mrutyun^

Read only

Former Member
0 Likes
675

Hi Kiran,

here a short example:

In sapscript you use:

/: PERFORM <b>ZMEDRUCK01_01</b> IN PROGRAM Z_FORMULAR_ROUTINEN

/: USING &EKPO-EMATN&

/: CHANGING &ZEINR&

/: CHANGING &ZEIVR&

/: ENDPERFORM

/*

IL ,,,,&ZEINR& IDX: &ZEIVR&

In Report Z_FORMULAR_ROUTINEN you have to define

a routine like this:

FORM ZMEDRUCK01_01 TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

*

READ TABLE IN_TAB WITH KEY 'EKPO-EMATN'.

*

check sy-subrc = 0.

MATNR_F = IN_TAB-VALUE.

*

SELECT SINGLE * FROM MARA WHERE MATNR = MATNR_F.

check sy-subrc = 0.

*

READ TABLE OUT_TAB WITH KEY = 'ZEINR'.

OUT_TAB-VALUE = MARA-ZEINR.

MODIFY OUT_TAB INDEX SY-TABIX.

*

READ TABLE OUT_TAB WITH KEY = 'ZEIVR'.

OUT_TAB-VALUE = MARA-ZEIVR.

MODIFY OUT_TAB INDEX SY-TABIX.

*

ENDFORM.

In itab OUT_TAB you can set the value of the fields you will use.

Hope it helps.

regards, Dieter

Read only

Former Member
0 Likes
675

hi,

/: PERFORM FORM1 IN PROGRAM ZTEST

/: USING &VAR1&

/: CHANGING &VAR_OUT1&

In program ZTEST...

FORM FORM1 tables in_tab structure itcsy

out_tab structure itcsy.

data: var1 like ...

read table in_tab with key name = 'VAR1'.

if sy-subrc = 0.

move in_tab-value to var1.

endif.

  • Update the value of VAR_OUT1

read table out_tab with key name = 'VAR_OUT1'.

if sy-subrc = 0.

move <value> to out_tab-value.

modify out_tab index sy-tabix.

endif.

ENDFORM.

check this...

http://help.sap.com/saphelp_erp2005/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm

do reward if it helps,

priya.

Read only

Former Member
0 Likes
675

You can do it in two ways

1. If you have copied the scripts driver program, you can declare new variables and populate them, and these will be automatically available with &FIELD& in the script, you can't transfer a internal table like this, for this you would need to LOOP-ENDLOOP and call the WINDOW each time to pass one row at a time

2. USING PERFORM - ENDPERFORM

<b>In SAPscript</b>

/: PERFORM TEST_ROUTINE IN PROGRAM ZTEST
/: USING &REGUP-BUKRS&
/: USING &REGUP-BELNR&
/: USING &REGUP-GJAHR&
/: CHANGING &MY_BKPF_AWKEY&
/: ENDPERFORM.

<b>In ABAP program ZTEST</b>

FORM TEST_ROUTINE TABLES IN_PAR STRUCTURE ITCSY OUT_PAR STRUCTURE ITCSY.

READ TABLE IN_PAR WITH KEY 'REGUP-BUKRS'.
IF SY-SUBRC = 0.
L_BUKRS = IN_PAR-VALUE.
ENDIF.

READ TABLE IN_PAR WITH KEY 'REGUP-BELNR'.
IF SY-SUBRC = 0.
L_BELNR = IN_PAR-VALUE.
ENDIF.

READ TABLE IN_PAR WITH KEY 'REGUP-GJAHR'.
IF SY-SUBRC = 0.
L_GJAHR = IN_PAR-VALUE.
ENDIF.

SELECT SINGLE AWKEY FROM BKPF INTO L_AWKEY WHERE BUKRS = L_BUKRS BELNR = L_BELNR GJAHR = L_GJAHR.

READ TABLE OUT_PAR WITH KEY 'MY_BKPF_AWKEY'.
IF SY-SUBRC = 0.
MY_BKPF_AWKEY = L_AWKEY.
ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.

Read only

Former Member
0 Likes
675

hi kiran

first of all u cant alter d standar form not only interms of window & logo but alos v cant change d data...the best ting is copy it and declare in d Z fdrmat and den make changes

vijay

Read only

kiran_k8
Active Contributor
0 Likes
675

problem solved