Kunal Surpurkar
New User
Joined: 15 Nov 2012 Posts: 47 Location: India
|
|
|
|
Dear Team,
I have a requirement wherein, a database has a parent and 2 children.
PARENT SEGMENT = SEGPADR
CHILD 1 = SEGMES
CHILD2 = SEGHIJO ( in the same order).
Now, the requirement is, to search for the values in SEGPADR, then SEGMES and then SEGHIJO.
There is a field IMESANO in the segment SEGMES which needs to be assigned to some other field in the output file.
But. the segment SEGMES has many SEGHIJOs under it.
My requirement is to first check SEGPADR and write its fields into the 1st output file.
Next, it should check for SEGMES segment and write IMESANO values to all the records and then look for the records in SEGHIJO and write them.
But, what is happening now is, It is only looking for first IMESANO value in SEGMES (There are many SEGMES under SEGPADR) and assigning this value to all the records. It is not looking for the next SEGMESes and writing the records, while it should do so.
I have used GNP call to retrieve the data from SEGMES and SEGHIJO.
Please let me know incase you need more information.
The piece of code of SEGMES:
B10_UNLOAD_SEGMES: PROC;
PROC_NAME = 'B10_UNLOAD_SEGMES';
DO WHILE(EOF_GMES = '0'B);
PUT SKIP LIST ('B10_UNLOAD_SEGMES');
CALL PLITDLI(FOUR,FUNC_GNP,IVAMOD_PCB,
SEGMES_IO_AREA,
SEGMES_UNQUAL_SSA);
PUT SKIP LIST ('STATUS1' || IVAMOD_PCB.IVAMOD_STAT_CODE);
SELECT (IVAMOD_PCB.IVAMOD_STAT_CODE);
WHEN (OKAY) DO;
PUT SKIP LIST('IFMONTH' || SEGMES_IO_AREA.IMESANO);
EOF_HIJO = '0'B;
CALL B10_UNLOAD_SEGHIJO;
END;
WHEN (EODB) DO;
PUT SKIP LIST ('NOT FOUND1');
EOF_GMES = '1'B;
END;
WHEN (NOTFOUND) DO;
PUT SKIP LIST ('NOT FOUND2');
EOF_GMES = '1'B;
END;
OTHERWISE DO;
WS_FUNCTION_CALL = FUNC_GNP;
RETURN_CODE = 8;
SIGNAL CONDITION (ERRDLI);
Thanks a lot in advance. |
|