2007 Nov 09 11:43 AM
Hello!
I'm creating a function module with table input parameters IT_OBJECT and output parameters IT_OBJECT_INS.
Also i'm creating ZTABLE with 6 fields. Some of these are the POBJECT and POBJECT_REF which are key fields.
If input parameter IT_OBJECT is populated, the process in the FM would be:
- to check if the data in the input parameter table exists in ZTABLE, that is ZTABLE-POBJECT IN IT_OBJECT
- ZTABLE-POBJECT_REF EQ ' '.
if the above conditions are satisfied I have to retrieve POBJECTS from ZTABLE.
QUESTION: I'm just not sure on how will I do the checking of the entries in IT_OBJECT against the entries in ZTABLE?
Thanks!
Bay
2007 Nov 09 2:12 PM
DO like this...
Create one more internal table which can store the data from the ZTABLE like IT_ZTAB.
Than, code like this
SELECT * FROM ZTABLE
INTO IT_ZTAB
FOR ALL ENTRIES IN IT_OBJECT
WHERE POBJECT = IT_OBJECT-POBJECT
AND POBJECT_REF EQ ' '.
LOOP AT IT_OBJECT.
READ TABLE IT_ZTAB WITH KEY POBJECT = IT_OBJECT-POBJECT.
IF SY-SUBRC = 0.
*** ENTRY FOUND
ENDIF.
ENDLOOP.Regards,
Naimesh Patel
Hello!
I'm creating a function module with table input parameters IT_OBJECT and output parameters IT_OBJECT_INS.
Also i'm creating ZTABLE with 6 fields. Some of these are the POBJECT and POBJECT_REF which are key fields.
If input parameter IT_OBJECT is populated, the process in the FM would be:
- to check if the data in the input parameter table exists in ZTABLE, that is ZTABLE-POBJECT IN IT_OBJECT
- ZTABLE-POBJECT_REF EQ ' '.
if the above conditions are satisfied I have to retrieve POBJECTS from ZTABLE.
QUESTION: I'm just not sure on how will I do the checking of the entries in IT_OBJECT against the entries in ZTABLE?
Thanks!
Bay
2007 Nov 09 2:12 PM
DO like this...
Create one more internal table which can store the data from the ZTABLE like IT_ZTAB.
Than, code like this
SELECT * FROM ZTABLE
INTO IT_ZTAB
FOR ALL ENTRIES IN IT_OBJECT
WHERE POBJECT = IT_OBJECT-POBJECT
AND POBJECT_REF EQ ' '.
LOOP AT IT_OBJECT.
READ TABLE IT_ZTAB WITH KEY POBJECT = IT_OBJECT-POBJECT.
IF SY-SUBRC = 0.
*** ENTRY FOUND
ENDIF.
ENDLOOP.Regards,
Naimesh Patel
2008 Jan 14 6:12 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |