on 2024 Oct 16 9:31 AM
I am implementing badi edoc_adaptor for changing edoc type in fb70 ...but in badi importing parameter io_source is object ... referring class cl_edoc_source and cl_edoc_source has method get_data ... holding field symbol es_data ...so basically i wanted to access field symbol using get_data method but i dont know the approach
Request clarification before answering.
So, you mean that you don't know the type of the variable returned by the method GET_DATA of CL_EDOC_SOURCE, because the type is generic:
methods GET_DATA
exporting
value(ES_DATA) type ANY .
Hopefully you can get the data reference via GET_DATA_REFERENCE:
methods GET_DATA_REFERENCE
returning
value(RD_DATA) type ref to DATA .
Your code will be:
DATA(ld_data) = io_source->get_data_reference( ).
ASSIGN ld_data->* TO FIELD-SYMBOL(<ls_data>).
If you have an old version of CL_EDOC_SOURCE which doesn't contain the GET_DATA_REFERENCE method, you may create a custom one via the enhancement framework named e.g. ZZGET_DATA_REFERENCE, with this code:
METHOD zzget_data_reference.
rd_data = md_data.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you saying that your system has the standard method GET_DATA_REFERENCE? I guess you had checked twice before asking me to confirm, so better check three times.
ASSIGN COMPONENT 'XXXX' OF STRUCTURE <ls_data> TO FIELD-SYMBOL(<XXXX>).
There are lots of documentation, blog posts and answers about field symbols.
User | Count |
---|---|
30 | |
22 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.