2008 Feb 19 4:28 PM
hi all,
plz solve my problem.
this is my first program.
tables vbak.
select-options x for vbak-vbeln.
types : beginf of ty,
a tupe vbak-vbeln,
b type vbak-ernam,
end of ty.
data : itab type table of ty,
wa type ty.
perform sub(znava) using x.
-
this is my secomd program
report znava.
form sub using x.
select vbeln ernam from vbak into table itab where vbeln in x.
loop at itab into wa.
write 😕 wa-a,wa-b.
endloop.
endform.
in the above two programs are separate,and i am using external subroutine but it will show some error how can i rectify.
anyone plz guide me.
thanks and regards,
navneeth.
Edited by: Navaneetha KRISHNAN on Feb 19, 2008 5:50 PM
2008 Feb 19 5:04 PM
First of all SELECT-OPTIONS are TABLE type.
You just can't use USING keyword, you've to use TABLES keyword.
second point is,, in your second program are you defining ITAB and WA??? otherwise second program is not going to identify ITAB & WA... so I suggest you try like this..
"program 1.
TABLES vbak.
SELECT-OPTIONS x FOR vbak-vbeln.
PERFORM sub(znava) TABLES x .
"program 2
TYPES : BEGIN OF ty,
a TYPE vbak-vbeln,
b TYPE vbak-ernam,
END OF ty.
DATA : itab TYPE TABLE OF ty,
wa TYPE ty.
FORM sub TABLES x.
SELECT vbeln ernam FROM vbak INTO TABLE itab WHERE vbeln IN x.
LOOP AT itab INTO wa.
WRITE :/ wa-a,wa-b.
ENDLOOP.
ENDFORM. "sub
First of all SELECT-OPTIONS are TABLE type.
You just can't use USING keyword, you've to use TABLES keyword.
second point is,, in your second program are you defining ITAB and WA??? otherwise second program is not going to identify ITAB & WA... so I suggest you try like this..
"program 1.
TABLES vbak.
SELECT-OPTIONS x FOR vbak-vbeln.
PERFORM sub(znava) TABLES x .
"program 2
TYPES : BEGIN OF ty,
a TYPE vbak-vbeln,
b TYPE vbak-ernam,
END OF ty.
DATA : itab TYPE TABLE OF ty,
wa TYPE ty.
FORM sub TABLES x.
SELECT vbeln ernam FROM vbak INTO TABLE itab WHERE vbeln IN x.
LOOP AT itab INTO wa.
WRITE :/ wa-a,wa-b.
ENDLOOP.
ENDFORM. "sub
2008 Feb 19 4:34 PM
Hi,
Form sub uses ENDLOOP when it should be using ENDSELECT.
If this is not the error you are getting, you should maybe tell us what the error is.
Regards,
Nick
2008 Feb 19 4:44 PM
i couldn't get u can u tell me the correct syntax for the whole program.
2008 Feb 19 4:42 PM
hi,
if this is the code of the subroutine, you copied into your post, than the LOOP is missing:
form sub using x.
select vbeln ernam from vbak into table itab where vbeln in x.
loop at itab into wa.
write 😕 wa-a,wa-b.
endloop.
endform.
hope this helps
ec
2008 Feb 19 4:46 PM
2008 Feb 19 4:50 PM
the correct program is in my first comment, just add the bold line to your original subroutine.
2008 Feb 19 4:53 PM
sorry it won't correct .that is my typical error .
can u suggest me the correct answer
2008 Feb 19 4:54 PM
that i missed as a typical error .even if i correct it . it wont give the correct result
2008 Feb 19 5:04 PM
First of all SELECT-OPTIONS are TABLE type.
You just can't use USING keyword, you've to use TABLES keyword.
second point is,, in your second program are you defining ITAB and WA??? otherwise second program is not going to identify ITAB & WA... so I suggest you try like this..
"program 1.
TABLES vbak.
SELECT-OPTIONS x FOR vbak-vbeln.
PERFORM sub(znava) TABLES x .
"program 2
TYPES : BEGIN OF ty,
a TYPE vbak-vbeln,
b TYPE vbak-ernam,
END OF ty.
DATA : itab TYPE TABLE OF ty,
wa TYPE ty.
FORM sub TABLES x.
SELECT vbeln ernam FROM vbak INTO TABLE itab WHERE vbeln IN x.
LOOP AT itab INTO wa.
WRITE :/ wa-a,wa-b.
ENDLOOP.
ENDFORM. "sub
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |