cancel
Showing results for 
Search instead for 
Did you mean: 

sy-subrc 4 erro rin subroutine

Former Member
0 Kudos

hi all,

i got sy-subrc value 4 in subroutine.this sy-subrc value is comine when read the output paramater value.

the subroutine has two input parameters and two output parameters .

it shows the sy-subrc 4 when reading 2nd output parameter value.

at the same time the 1st output parametr vaule also not displayed in form.

pl tel me y this error is coming?Thanks.

Edited by: Ranganayahi Chandirasekaran on Mar 9, 2008 10:30 AM

Edited by: Ranganayahi Chandirasekaran on Mar 9, 2008 10:39 AM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check that parameter 'VALUE2' should be used in script as

/: CHANGING VALUE2 in the perform.

Spelling of parameter should be same at both places.

Hope it will solve your problem.

Thanks,

Parul.

Former Member
0 Kudos

hi,

Sample program coding:

REPORT ZAR_TEST.

DATA: A1 TYPE I,

A2 TYPE I,

A3 TYPE C.

FORM SAP TABLES T1 STRUCTURE ITCSY T2 STRUCTURE ITCSY.

READ TABLE T1 INTO T1 INDEX 1.

MOVE T1-VALUE TO A1.

*WRITE: A1.

READ TABLE T1 INTO T1 INDEX 2.

MOVE T1-VALUE TO A2.

*WRITE: A2.

A3 = A1 + A2.

READ TABLE T2 INDEX 1.

MOVE A3 TO T2-VALUE.

MODIFY T2 INDEX 1 FROM T2 TRANSPORTING VALUE.

ENDFORM.

sample form coding in edit text:

DEFINE &I1& = '2'

DEFINE &I2& = '3'

DEFINE &I3&

PERFORM SAP IN PROGRAM ZAR_TEST

USING &I1&

USING &I2&

CHANGING &I3&

ENDPERFORM

CHANGING RESULT I3 = &I3&

Thanks,

Reward if useful.

Arunprasad.P

Former Member
0 Kudos

hi,

After doing all ur calculations pass the values to the variable that has been declared as a character ...bcoz the form can accept the Character type variables only so pass it to the character type variables.

Thanks,

Reward if useful.

Arunprasad.P

Former Member
0 Kudos

hi,

in the below coding,the 2nd ourpar value alone changed and updated into outpar table,the first value was read and come to header ,which is not updated into the oupar table.pl help me out.Thanks.

FORM TAX_AMT TABLES INPAR STRUCTURE ITCSY

OUTPAR STRUCTURE ITCSY.

here i wrote all the codings for validation part

both wrbtr1 and value 2 having values.

wrbtr1 and values are char type.

READ TABLE OUTPAR WITH KEY 'WRBTR1'.

CHECK SY-SUBRC EQ 0.

OUTPAR-VALUE = WRBTR1.

READ TABLE OUTPAR WITH KEY 'VALUE2'.

CHECK SY-SUBRC EQ 0.

OUTPAR-VALUE = VALUE2.

MODIFY OUTPAR INDEX SY-TABIX.

endform.

Edited by: Ranganayahi Chandirasekaran on Mar 10, 2008 5:51 AM

Former Member
0 Kudos

The subroutine is not able to read the second output value that's why sy-subrc = 0. Check why its not able to read the second output. may be not passes in the subroutine.

without coding difficult to find out why 1st parameter is not appering in form.

anya