2016 Aug 02 3:18 PM
Hello,
I've a requirement to create a report which works similar to WE09.
The report needs to find the IDOC number based on the segment, field & value.
(like E1EDKA1, IHREZ, Invoivce number)
I know the IDOC segment data can be found in EDID4-SDATA.
I've trouble with finding the offset & length of the required field in offset.
I've tried to use c call CALL 'C_DD_READ_FIELD' & FM DDIF_FIELDINFO_GET.
They don't produce the desired result.
Is there any way to find the offset & length of a particular SEGMENT-FIELD given dynamically at runtime.
Please help with resolving this issue.
Thanks & Regards,
Balaji.
2016 Aug 03 1:44 PM
Hi Balaji,
You can take the 'SEGNAM' from EDID4 and pass the SDATA in a structure of that SEGNAM.
Example :
if you have segnam E1EDKA1,
wa_E1EDKA1 = edid4-sdata. ( where wa_E1EDKA1 type E1EDKA1 ).
you can then find the value of IHREZ in wa_E1EDKA1-IHREZ.
Regards,
Sampat
2016 Aug 02 3:27 PM
How different will your report be, compared to WE09? What other functionality would you like to achieve in your report?
Since WE09 is an ALV report, you could submit WE09, from your report and then use method to get back the ALV report from WE09, without having to code the entire data fetch mechanism yourselves.
Thanks,
Juwin
2016 Aug 03 1:34 PM
I'll need to pass multiple values into selection screen and compare it with the value in the SEGMENT-FIELD
2016 Aug 02 6:26 PM
As mentioned above when it is possible try to stick to standard transactions instead of creating your own.
Answering your question EDID4 has field SEGNAM which represents IDoc segment name and corresponds to existing dictionary type. Moreover IDoc segments consist of field of type CHAR hence you could simply iterate over structure components and count the length from the beginning to the field you are interested in.
2016 Aug 03 1:44 PM
Hi Balaji,
You can take the 'SEGNAM' from EDID4 and pass the SDATA in a structure of that SEGNAM.
Example :
if you have segnam E1EDKA1,
wa_E1EDKA1 = edid4-sdata. ( where wa_E1EDKA1 type E1EDKA1 ).
you can then find the value of IHREZ in wa_E1EDKA1-IHREZ.
Regards,
Sampat