cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with child node in the DOE

waldemar_schakiel
Participant
0 Kudos

Hello together,

I have created a data object "service" from following BAPI-wrappers:

FUNCTION zmob_service_getlist.

*"----


""Local Interface:

*" TABLES

*" SERVICE_HEADER STRUCTURE ZMOB_SERVICEH

*" RETURN STRUCTURE BAPIRET2

*"----


code

ENDFUNCTION.

FUNCTION ZMOB_SERVICE_GETDETAIL.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(SPEC_NO) TYPE ZMOB_SERVICEH-SPEC_NO OPTIONAL

*" EXPORTING

*" VALUE(SERVICE_HEADER) TYPE ZMOB_SERVICEH

*" TABLES

*" SERVICE_ITEM STRUCTURE ZMOB_SERVICEP

*" RETURN STRUCTURE BAPIRET2

*"----


code

ENDFUNCTION.

Those function modules delivers correct data in backend system.

My Problem:

The adequate CDS table for root node SERVICE_HEADER contains data but the CDS table for child node SERVICE ITEM is empty.

What is the reason for this problem?

Regards

Waldemar Schakiel

Accepted Solutions (0)

Answers (7)

Answers (7)

waldemar_schakiel
Participant
0 Kudos

Hello,

Sorry, it was an error in my function module.

waldemar_schakiel
Participant
0 Kudos

Hello,

the key ZMOB_SERVICEH-SPEC_NO is filled correctly in the debug session.

The rfc destination is OK. I mean, can I debug my rfc function module in backend from my debug session ?

Regards

Waldemar

Former Member
0 Kudos

No. You will not be able to debug the RFC call during the flow.

But you can note down the inputs to your bapi wrapper call and then execute the bapi wrapper in the backend using those parameter values.

Regards,

Ramanath.

waldemar_schakiel
Participant
0 Kudos

Hello,

I have debugged the method get_bedata of backend adapter. My function module for get_detail delivers no results!

When I run the same function module directly in backend then it returns correct data.

Is there a possibility to navigate into this RFC function module during debug session?

Regards

Waldemar

Former Member
0 Kudos

Hi,

Is the field ZMOB_SERVICEH-SPEC_NO filled properly while invoking getdetail and is this the only backend key for the header structure?

Regards,

Liji

Former Member
0 Kudos

Hi,

Have you mentioned correct RFC destination so that correct backend system is being invoked by DOE?

Regards,

Ramanath.

waldemar_schakiel
Participant
0 Kudos

Hello Arjun,

here the adequate code from backand adapter:

loop at i_header into ls_header.

  • Assign object keys

SPEC_NO = ls_header-SPEC_NO.

clear SERVICE_HEADER.

clear RETURN.

clear SERVICE_ITEM.

  • Call GetDetail/GetBulkDetail BapiWrapper

if bei_int_hdr-notf_task <> babw_delete.

clear: l_task,

l_mbo_message.

clear tracedata.

tracestr = SPEC_NO.

concatenate tracedata 'SPEC_NO' '='

tracestr into tracedata separated by space.

concatenate tracedata ';' into tracedata.

call function 'ZMOB_SERVICE_GETDETAIL'

destination rfc_dest

exporting

SPEC_NO = SPEC_NO

importing

SERVICE_HEADER = SERVICE_HEADER

tables

RETURN = RETURN

SERVICE_ITEM = SERVICE_ITEM

exceptions

system_failure = 1 message ls_bapiret-message

communication_failure = 2 message ls_bapiret-message

others = 3.

if sy-subrc <> 0.

l_task = lc_ignore.

if sy-subrc = 3.

call function 'SMGF_FILL_BAPIRET'

exporting

type = 'A'

cl = 'MMWBAPIADP'

number = 025

par1 = 'ZMOB_SERVICE_GETDETAIL'

importing

bapireturn = ls_bapiret.

append ls_bapiret to e_return.

e_state = babw_otherfail.

else.

ls_bapiret-type = 'A'.

append ls_bapiret to e_return.

if sy-subrc = 1.

e_state = babw_sysfail.

else.

e_state = babw_commfail.

endif.

endif.

endif.

if return is not initial.

set_task_ignore_if_error.

append lines of return to e_return.

endif.

  • Check if the header returned is empty

if ( SERVICE_HEADER is initial

and SERVICE_ITEM is initial

).

l_task = lc_ignore.

if bei_int_hdr-load_type = babw_upload.

l_msg_type = babw_error.

else.

l_msg_type = babw_warning.

endif.

call function 'SMGF_FILL_BAPIRET'

exporting

type = l_msg_type

cl = 'MMW_BEI_MON'

number = 026

par1 = ''

importing

bapireturn = ls_bapiret.

append ls_bapiret to e_return.

endif.

endif.

clear lt_header.

if SERVICE_HEADER is initial.

append ls_header to lt_header.

else.

if SERVICE_HEADER-SPEC_NO is initial.

SERVICE_HEADER-SPEC_NO = SPEC_NO.

endif.

append SERVICE_HEADER to lt_header.

endif.

call method map_to_mbo

exporting

SERVICE_HEADER = lt_header

SERVICE_ITEM = SERVICE_ITEM

mbo_message_comm_hdr = mbo_message_comm_hdr

task = l_task

importing

mbo_message_body = l_mbo_message

changing

e_return = e_return.

check_bapiret e_return.

if bei_int_hdr-notf_task = babw_delete.

ls_root_node-task = babw_delete.

modify l_mbo_message-SERVICE_HEADER

from ls_root_node

transporting task

where task <> babw_delete.

endif.

append lines of l_mbo_message-SERVICE_HEADER

to mbo_out-SERVICE_HEADER.

append lines of l_mbo_message-SERVICE_ITEM

to mbo_out-SERVICE_ITEM.

endloop.

Former Member
0 Kudos

Hi,

Please check the getdetail BAPI and execute it manually and verify that items in tables parameters are returned by the backend.

Also, Please make sure the system is updated with all available notes for that SP.

Former Member
0 Kudos

What Rohit said is right. Just double check the GetDetail. If its fine, then IMO, a debug session is the only way.

waldemar_schakiel
Participant
0 Kudos

Hello Arjun,

my data object was created from BAPI wrappers. Mapping is defined in the backend adapter and key fields in the child node too.

Regards

Waldemar

Former Member
0 Kudos

From what you say, it looks like metadata is fine. Lets look at some generated code then!

1. Open up the Adapter in SDOE_WB transaction

2. Look for 'Gen Class Name' in the Adapter Details tab and navigate to it

3. Navigate to the GET_BEDATA method there

4. Look for a call to your GETDETAIL function module, and see if its there. If yes, then maybe you could paste a code snippet?

Former Member
0 Kudos

From what you say, it looks like metadata is fine. Lets look at some generated code then!

1. Open up the Adapter in SDOE_WB transaction

2. Look for 'Gen Class Name' in the Adapter Details tab and navigate to it

3. Navigate to the GET_BEDATA method there

4. Look for a call to your GETDETAIL function module, and see if its there. If yes, then maybe you could paste a code snippet?

Former Member
0 Kudos

Missed mappings?

Check the Backend adapter for mappings between the getdetail return table (child node) and the data object child node fields.

Also: How did you create this Data Object? If its via BAPI Wrapper import, then you have to explicitly 'check' the key fields of the child node (because these are not possible to identify during the import)

Former Member
0 Kudos

Missed mappings?

Check the Backend adapter for mappings between the getdetail return table (child node) and the data object child node fields.

Also: How did you create this Data Object? If its via BAPI Wrapper import, then you have to explicitly 'check' the key fields of the child node (because these are not possible to identify during the import)