2006 Dec 05 8:54 AM
hi ,
i want to retrive data from a variable country , this is in the following heirarchy
I_tab-item-shipfrom_locationadress_data-country .
wher itab is a structure ,
item is a table type ,
shipfrom_location is structure ,
country is variable
i just want to retrive data from variable ,
if it is structure i can just give
I_tab-item-shipfrom_locationadress_data-country .
but as item is table type ,i dont no to retrive data , pls send some suggestion with example .
thanking you
ssridhar
2006 Dec 05 8:59 AM
You can declare a variable of the table type of the ITEM.
DATA : IT_ITEMTABLE type (Same as that of ITEM column in ITAB).
Then
IT_ITEMTABLE = I_TAB-ITAM.
LOOP AT IT_ITEMTABLE INTO WA_ITEMTABLE.
Process the data
ENDLOOP.
Regards,
Ravi
Note - Please mark all the helpful ansewrs
You can declare a variable of the table type of the ITEM.
DATA : IT_ITEMTABLE type (Same as that of ITEM column in ITAB).
Then
IT_ITEMTABLE = I_TAB-ITAM.
LOOP AT IT_ITEMTABLE INTO WA_ITEMTABLE.
Process the data
ENDLOOP.
Regards,
Ravi
Note - Please mark all the helpful ansewrs
2006 Dec 05 8:59 AM
You can declare a variable of the table type of the ITEM.
DATA : IT_ITEMTABLE type (Same as that of ITEM column in ITAB).
Then
IT_ITEMTABLE = I_TAB-ITAM.
LOOP AT IT_ITEMTABLE INTO WA_ITEMTABLE.
Process the data
ENDLOOP.
Regards,
Ravi
Note - Please mark all the helpful ansewrs
2006 Dec 05 9:43 AM
it is showing a error , the type wa_item cannot be conveted into to the type I_TAB-ITEM
2006 Dec 05 9:50 AM
2006 Dec 05 8:59 AM
simple.
data : wa_item like i_tab-item.
Loop at I_TAB-ITEM INTO WA_ITEM.
write : WA_ITEM-shipfrom_locationadress_data-country.
endloop.
2006 Dec 05 9:49 AM
hi,
i_tab-item is your table type.
you create an internal table wa_item using this code --
data wa_item like table of i_tab.
now try retrieving data from the internal table using loop statement.
loop at wa_itam into i_tab.
write: ....
endloop.
try this.
regards
pankaj
2006 Dec 05 10:04 AM
read table i_tab into itab_str index 1.
data wa_party like table of i_tab.
loop at wa_party into i_tab.
write:/ wa_party-ADDRESS_DATA-country .
endloop .
it is showing me a error that wa_party has no header line
pls i hope i making blender mistake .
thanking you
sridhar
2006 Dec 05 10:06 AM
Hi,
data wa_party like line of i_tab.
loop at i_tab into wa_party.
write:/ wa_party-ADDRESS_DATA-country .
endloop .
Message was edited by:
Jayanthi Jayaraman
2006 Dec 05 10:11 AM
hi,
declare an internal table with header line and move th content into it in this way.
data: itab1 like item with header line.
itab1[] = I_tab-item[].
x_struct like shipfrom_locationadress_data.
loop at itab1.
x_struct = itab1-shipfrom_locationadress_data.
write:/ x_struct-country.
endloop.
2006 Dec 05 10:42 AM
data: ordid_str type /SCMB/DM_ORDID_str,
ordid_tab type /SCMB/DM_ORDID_TAB.
data: i_party type /SCMB/DM_PARTY_str.
CREATE OBJECT grid1 .
read table gt_po_detl index 1 .
move gt_po_detl-ordid to ordid_str-ordid.
append ordid_str to ordid_tab.
CALL METHOD grid1->READ_BY_IDS
EXPORTING
IS_CTRL =
IV_ORTYPE = gt_po_detl-ortype
IV_LOCKFLG = /SCMB/CL_C_ORDER=>GC_FALSE
IV_NOADDRESS = /SCMB/CL_C_ORDER=>GC_FALSE
IV_MAPID = /SCMB/CL_C_ORDER=>GC_FALSE
IV_DUEQUAN = /SCMB/CL_C_ORDER=>GC_FALSE
IT_ORDERID = ordid_tab
IMPORTING
ET_ORDERS = i_tab
ET_PROT =
.
read table i_tab into itab_str index 1.
data wa_party like table of itab_str.
loop at wa_party into itab_str .
write:/ wa_party-ADDRESS_DATA-country .
break-point .
endloop this is coding
2006 Dec 05 11:16 AM
Hi,
go for speed:
field-symbols:
<f1> type any,
<f2> type any.
loop at I_tab-item assigning <f1>.
assign component 'COUNTRY' of structure <f1> to <f2>.
write: / 'Country for this item ''s shipfrom_locationadress:', <f2>.
endloop.
See also this valuable link:
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3605358411d1829f0000e829fbfe/content.htm">Access Using Field Symbols</a>
Regards,
Clemens
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |