Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

calling idoc_input_creditor

Former Member
0 Likes
669

hi

how to populate the input fields while calling the fucntion idoc_input_creditor.

pls suggest with some code

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
565

hi george

you can refer to the link may be this link will help out your query

regards

Saurabh goel

Edited by: Saurabhgoels on Jul 7, 2009 12:05 PM

hi

how to populate the input fields while calling the fucntion idoc_input_creditor.

pls suggest with some code

2 REPLIES 2
Read only

Former Member
0 Likes
565

Hi,

idoc_data-segnam has the segment name...match with it and then from the segment take the values and populate in internal table and update ur table.

U can easily understand with this code.

FUNCTION Z_IDOC_INPUT_ZSPFLIIN.

*"----


""Local interface:

*" IMPORTING

*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD

*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC

*" EXPORTING

*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT

*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR

*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK

*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS

*" TABLES

*" IDOC_CONTRL STRUCTURE EDIDC

*" IDOC_DATA STRUCTURE EDIDD

*" IDOC_STATUS STRUCTURE BDIDOCSTAT

*" RETURN_VARIABLES STRUCTURE BDWFRETVAR

*" SERIALIZATION_INFO STRUCTURE BDI_SER

*" EXCEPTIONS

*" WRONG_FUNCTION_CALLED

*"----


include mbdconwf.

data: it_spfli type table of spfli,

wa_spfli like line of it_spfli.

data : wa type zspfli.

workflow_result = c_wf_result_ok.

loop at idoc_contrl.

if idoc_contrl-mestyp ne 'ZTEST13'.

raise wrong_function_called.

endif.

clear it_spfli.

refresh it_spfli.

loop at idoc_data where docnum eq idoc_contrl-docnum.

case idoc_data-segnam.

when 'ZSEGMENT1'.

move idoc_data-sdata to wa.

wa_spfli-carrid = wa-carrid.

wa_spfli-connid = wa-connid.

append wa_spfli to it_spfli.

endcase.

endloop.

insert spfli from table it_spfli.

if sy-subrc eq 0.

return_variables-wf_param ='Processed_idocs'.

return_variables-doc_number = idoc_contrl-docnum.

return_variables-wf_param = 'Appl_objects'.

return_variables-doc_number = idoc_contrl-docnum.

append return_variables. "Return variables indicating success.

idoc_status-docnum = idoc_contrl-docnum.

idoc_status-status = '53'.

idoc_status-msgty = 'I'.

idoc_status-msgid = 'ZSPFLI'.

idoc_status-msgno = '001'.

idoc_status-msgv1 = idoc_contrl-docnum.

append idoc_status. "Status record indicating success.

else.

workflow_result = c_wf_result_error.

return_variables-wf_param = 'error_idocs' .

return_variables-doc_number = idoc_contrl-docnum.

append return_variables.

idoc_status-docnum = idoc_contrl-docnum.

idoc_status-status = '51'.

idoc_status-msgty = 'E'.

idoc_status-msgid = 'ZSPFLI'.

idoc_status-msgno = '002'.

idoc_status-msgv1 = idoc_contrl-docnum.

append idoc_status.

endif.

endloop.

ENDFUNCTION.

Hope u r clear....

Kind Regards

Sajid

Edited by: shaik sajid on Jul 7, 2009 11:58 AM

Read only

Former Member
0 Likes
566

hi george

you can refer to the link may be this link will help out your query

regards

Saurabh goel

Edited by: Saurabhgoels on Jul 7, 2009 12:05 PM