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

Changing parameter value is not passing to form

Former Member
0 Likes
1,781

Dear Experts,

I have called a perform cmmand from a SAPScript passing two variable dateparameters one as using parameter and another as changing parameter.My logic is like that when changing parameter is blank it should feel with in the form but if not initial it should come as it is before.While i test passing the changing parameter as filled it shows the value in sap script but when i call ther form the value field goes empty.

PERFORM ZCAL IN PROGRAM ZF130_CONFIRM

USING &RF130-ABSTIDAT&

CHANGING &RF130-RUECKDAT&

ENDPERFORM

FORM ZCAL TABLES B_RF130 STRUCTURE ITCSY "RF130

L_RF130 STRUCTURE ITCSY. "-RUECKDAT.

BREAK-POINT.

DATA:DAT(2) TYPE C,

MON(2) TYPE C,

YR(4) TYPE C,

L_LOCAL(13) TYPE C,

FINAL_DAT LIKE RF130-RUECKDAT.

DATA:DOT(1) TYPE C VALUE '.'.

READ TABLE L_RF130 WITH KEY 'RF130-RUECKDAT'.

IF SY-SUBRC EQ 0 AND L_RF130-VALUE IS INITIAL.

READ TABLE B_RF130 WITH KEY 'RF130-ABSTIDAT'.

IF SY-SUBRC EQ 0.

SPLIT B_RF130-VALUE AT DOT INTO DAT MON YR.

CONCATENATE YR MON DAT INTO FINAL_DAT.

CLEAR: DAT, MON, YR.

FINAL_DAT = FINAL_DAT + 7.

YR = FINAL_DAT+0(4).

MON = FINAL_DAT+4(2).

DAT = FINAL_DAT+6(2).

CONCATENATE DAT DOT MON DOT YR INTO L_RF130-VALUE.

  • L_RF130-VALUE = FINAL_DAT.

CLEAR: DAT,MON,YR,FINAL_DAT.

ELSEIF SY-SUBRC EQ 0 AND L_RF130-VALUE IS NOT INITIAL.

READ TABLE L_RF130 WITH KEY 'RF130-RUECKDAT'.

IF SY-SUBRC EQ 0.

L_RF130-VALUE = L_RF130-VALUE.

ENDIF.

ENDIF.

MODIFY L_RF130 INDEX 1.

ENDIF.

ENDFORM. "ZCAL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,278

On your entry into your subroutine, the output side table will be initial, so all that stuff isn't needed... read your input table INDEX 1. Get your date from VALUE. Do your calculations. Read output table index 1. Insert the date into output-value. modify the output index 1.

Most of us would probably also declare a variable with /: define &mydate& = ' ', and change that with the perform routine, then use that in our SAPScript output.

From re-reading your post, it appears that you need two parameters in USING, and one in changing....therefore, change it to using both dates and changing one date...one date will be in your input table-VALUE index 1, the other in VALUE index 2. Your changing will go into the output-value index 1.

Dear Experts,

I have called a perform cmmand from a SAPScript passing two variable dateparameters one as using parameter and another as changing parameter.My logic is like that when changing parameter is blank it should feel with in the form but if not initial it should come as it is before.While i test passing the changing parameter as filled it shows the value in sap script but when i call ther form the value field goes empty.

PERFORM ZCAL IN PROGRAM ZF130_CONFIRM

USING &RF130-ABSTIDAT&

CHANGING &RF130-RUECKDAT&

ENDPERFORM

FORM ZCAL TABLES B_RF130 STRUCTURE ITCSY "RF130

L_RF130 STRUCTURE ITCSY. "-RUECKDAT.

BREAK-POINT.

DATA:DAT(2) TYPE C,

MON(2) TYPE C,

YR(4) TYPE C,

L_LOCAL(13) TYPE C,

FINAL_DAT LIKE RF130-RUECKDAT.

DATA:DOT(1) TYPE C VALUE '.'.

READ TABLE L_RF130 WITH KEY 'RF130-RUECKDAT'.

IF SY-SUBRC EQ 0 AND L_RF130-VALUE IS INITIAL.

READ TABLE B_RF130 WITH KEY 'RF130-ABSTIDAT'.

IF SY-SUBRC EQ 0.

SPLIT B_RF130-VALUE AT DOT INTO DAT MON YR.

CONCATENATE YR MON DAT INTO FINAL_DAT.

CLEAR: DAT, MON, YR.

FINAL_DAT = FINAL_DAT + 7.

YR = FINAL_DAT+0(4).

MON = FINAL_DAT+4(2).

DAT = FINAL_DAT+6(2).

CONCATENATE DAT DOT MON DOT YR INTO L_RF130-VALUE.

  • L_RF130-VALUE = FINAL_DAT.

CLEAR: DAT,MON,YR,FINAL_DAT.

ELSEIF SY-SUBRC EQ 0 AND L_RF130-VALUE IS NOT INITIAL.

READ TABLE L_RF130 WITH KEY 'RF130-RUECKDAT'.

IF SY-SUBRC EQ 0.

L_RF130-VALUE = L_RF130-VALUE.

ENDIF.

ENDIF.

MODIFY L_RF130 INDEX 1.

ENDIF.

ENDFORM. "ZCAL

4 REPLIES 4
Read only

franois_henrotte
Active Contributor
0 Likes
1,278

the changing parameter is more like an EXPORTING parameter, any value in it is not taken from outside : it can be only filled inside your routine

it is disturbing that we call it a CHANGING parameters as it is not really one

Read only

Former Member
0 Likes
1,278

Hi friend

I am not clear about ur reply...then how can i get the calculated new value(which is been calculated with in the form) back to the SAP Script?Pls suggest a way so that i can calculate the value with in the for and can display it ti sap script.

Read only

Former Member
0 Likes
1,279

On your entry into your subroutine, the output side table will be initial, so all that stuff isn't needed... read your input table INDEX 1. Get your date from VALUE. Do your calculations. Read output table index 1. Insert the date into output-value. modify the output index 1.

Most of us would probably also declare a variable with /: define &mydate& = ' ', and change that with the perform routine, then use that in our SAPScript output.

From re-reading your post, it appears that you need two parameters in USING, and one in changing....therefore, change it to using both dates and changing one date...one date will be in your input table-VALUE index 1, the other in VALUE index 2. Your changing will go into the output-value index 1.

Read only

Former Member
0 Likes
1,278

Thanx a lot friends my issue is solved