2010 Mar 15 11:16 AM
hi ,
i have this code .
TYPES: BEGIN OF zt_temp,
vbeln TYPE vbeln_va, "Sales Document
posnr TYPE posnr_va, "Sales Document Item
END OF zt_temp.
DATA : ist_temp2 TYPE TABLE OF ZT_temp.
PERFORM get_so_char_alt TABLES ist_temp2.
form GET_SO_CHAR_ALT tables p_ist_temp2 structure zt_temp .
abd..
endform .in the perform i gets error structure zt_temp is unknown . also i have to pass 2 internal tables to this perform how can i do it ?
Plz help ...... is there any other way to do it ? can i sue changing on internal tables ?
2010 Mar 15 11:22 AM
Hi,
Use the below declartion for FORM and ENDFROM
form GET_SO_CHAR_ALT tables p_ist_temp2 TYPE zt_temp .
abd..
endform .
Instead of structure define it as a TYPE it will solve ur problem.
hi ,
i have this code .
TYPES: BEGIN OF zt_temp,
vbeln TYPE vbeln_va, "Sales Document
posnr TYPE posnr_va, "Sales Document Item
END OF zt_temp.
DATA : ist_temp2 TYPE TABLE OF ZT_temp.
PERFORM get_so_char_alt TABLES ist_temp2.
form GET_SO_CHAR_ALT tables p_ist_temp2 structure zt_temp .
abd..
endform .in the perform i gets error structure zt_temp is unknown . also i have to pass 2 internal tables to this perform how can i do it ?
Plz help ...... is there any other way to do it ? can i sue changing on internal tables ?
2010 Mar 15 11:22 AM
Try sommenthing like following
TYPES: BEGIN OF zt_temp,
vbeln TYPE vbeln_va, "Sales Document
posnr TYPE posnr_va, "Sales Document Item
END OF zt_temp.
TYPES : tbl_zt_termp TYPE TABLE OF zt_temp.
DATA : ist_temp2 TYPE tbl_zt_termp,
ist_temp3 TYPE tbl_zt_termp.
PERFORM get_so_char_alt TABLES ist_temp2
ist_temp3.
form GET_SO_CHAR_ALT tables p_ist_temp2 TYPE tbl_zt_termp
p_ist_temp3 TYPE tbl_zt_termp.
endform .
2010 Mar 15 11:22 AM
Hi,
Use the below declartion for FORM and ENDFROM
form GET_SO_CHAR_ALT tables p_ist_temp2 TYPE zt_temp .
abd..
endform .
Instead of structure define it as a TYPE it will solve ur problem.
2010 Mar 15 11:25 AM
will it change my internal table according to changes done in perform .?
I mean im using tables statement so whether it will change my internal table or will keep as it is .?
2010 Mar 15 11:32 AM
Generally changes to TABLES, CHANGING parameters will reflect in the passed parameter, unless it is passed by VALUE and form executes incorrectly.
But in your case this is similar to writting CHANGES with correct table typing.
Regards
Marcin
2010 Mar 15 11:45 AM
so what i should do ? what to use ? i need to change the contents of internal table im passing .....
plz write some statements for my code.
Regards .
2010 Mar 15 11:54 AM
Hi,
Report ztest.
" Just Execute this and Check
DATA : carrid TYPE sflight-carrid VALUE 'AA',
connid TYPE sflight-connid VALUE '0017'.
DATA : itab TYPE TABLE OF sflight WITH HEADER LINE.
DATA : jtab TYPE TABLE OF spfli WITH HEADER LINE.
PERFORM get_data TABLES itab
jtab " U can add second table like this
USING carrid " Two Parameters like this
connid.
FORM get_data TABLES p_itab STRUCTURE sflight
p_jtab STRUCTURE spfli
USING p_carrid
p_connid.
SELECT * FROM sflight INTO TABLE itab
WHERE carrid = carrid
AND connid = connid.
IF sy-subrc = 0.
LOOP AT itab.
WRITE :/ itab-carrid,
itab-connid.
ENDLOOP.
ENDIF.
ENDFORM. " get_dataCheerz
Ram
2010 Mar 15 11:28 AM
Hi,
You can use 'Changing' and you can pass 2 tables separated by a space.
Thanks
Mani
2010 Mar 15 11:54 AM
These statements are equal, meaning there is no difference in using one of them
TYPES: BEGIN OF zt_temp,
vbeln TYPE vbeln_va, "Sales Document
posnr TYPE posnr_va, "Sales Document Item
END OF zt_temp.
TYPES: ztt_temp type table of zt_temp.
"First call with TABLES
PERFORM get_so_char_alt TABLES ist_temp2.
form GET_SO_CHAR_ALT tables p_ist_temp2 type ztt_temp.
...
endform .
"Second call with CHANGING
PERFORM get_so_char_alt CHANGING ist_temp2.
form GET_SO_CHAR_ALT changing p_ist_temp2 type ztt_temp.
...
endform .
Regards
Marcin
2010 Mar 15 12:12 PM
its giving error at form GET_SO_CHAR_ALT tables p_ist_temp2 type ztt_temp.
2010 Mar 15 12:15 PM
as it is not table
of type standard table ofso getting error what to do ?
2010 Mar 15 12:19 PM
You are not too specific about what the error says and how your code looks like. Do you really expect we can help you based on shred of information you provide each time.
2010 Mar 17 11:44 AM
Thanks all for your replies !! Marcin gave very helpful suggestion .
2010 Mar 15 12:37 PM
hi ujjwal,
in perform yuo can pass parameters in three ways-- using,changing and tables.
if you only want to use the parameter and dont want to change it then you can pass it with using,
if you wnt to change it then you have to pass it with changing , u can also pass table in changing parameter,
if you want to work with table,then you can pass it with tables also you can change the value of table with table
you can pass as many table as you want.
TYPES: BEGIN OF zt_temp,
vbeln TYPE vbeln_va, "Sales Document
posnr TYPE posnr_va, "Sales Document Item
END OF zt_temp.
DATA : wa_temp2 TYPE ZT_temp,
ist_temp2 like standard TABLE OF wa_temp2.
PERFORM get_so_char_alt TABLES ist_temp2 ist_temp3.
form GET_SO_CHAR_ALT tables p_ist_temp2 like ist_temp2
p_ist_temp3 like ist_temp2.
abd..
endform .
you can pass as many tables you want.
hope this post helps you.
thanks
Tanmaya
2010 Mar 22 9:45 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |