2008 Mar 24 11:28 AM
hi friends
how to pass the internal table value to method .
regards
pauldharma
hi friends
how to pass the internal table value to method .
regards
pauldharma
2008 Mar 24 11:33 AM
Are you looking for this??
Loop at itab.
call method class=>method exporting value = itab-field1
importing xxxx = xxxx.
endloop.
2008 Mar 24 11:37 AM
how to pass the internal table value to method but not used with in the loop statement
2008 Mar 24 11:35 AM
Hi,
To pass the values to a function or variable or what ever it is from internal table means we want to use loop/endloop.
Loop at <internal table>
inside u can trnsfer the values
endloop.
REWARd if useFUL
2008 Mar 24 11:37 AM
how to pass the internal table value to method but not used with in the loop statement
2008 Mar 24 11:36 AM
Hi,
See this example coding..
data : IT_PARTMP LIKE ZGLGRPDEF OCCURS 0 WITH HEADER LINE,
IT_GLMTMP LIKE ZGLMASTER OCCURS 0 WITH HEADER LINE.
PERFORM UPLOAD_MAST TABLES IT_GLTEMP .
PERFORM UPLOAD_MAST TABLES IT_PARTEMP.
FORM UPLOAD_MAST TABLES ITAB .
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'c:\'
FILETYPE = 'DAT'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV
endif.Regards,
Balakumar.G.
Reward Points if Helpful.
2008 Mar 24 11:37 AM
Hi,
see this example.
CLASS cls DEFINITION.
PUBLIC SECTION.
TYPES:t_mara TYPE TABLE OF mara.
METHODS:meth IMPORTING mats TYPE t_mara.
ENDCLASS.
CLASS cls IMPLEMENTATION.
METHOD meth.
DATA:wa_mara TYPE mara.
LOOP AT mats INTO wa_mara.
write:/ wa_mara-matnr.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA:obj TYPE REF TO cls.
CREATE OBJECT obj.
DATA:itab like TABLE OF mara.
SELECT * from mara into table itab UP TO 10 rows.
CALL METHOD obj->meth
EXPORTING mats = itab.
rgds,
bharat.
2008 Mar 24 11:39 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |