Action Taken | Call FM CVAPI_DOC_GETDETAIL with importing parameter as OLD_DOKNR |
Code Snippet | CALL FUNCTION 'CVAPI_DOC_GETDETAIL' EXPORTING pf_dokar = DOKAR (Document Type) pf_doknr = OLD_DOKNR pf_dokvr = '00' pf_doktl = '000' TABLES pt_files = lt_files_previous EXCEPTIONS not_found = 1 no_auth = 2 error = 3 OTHERS = 99. |
Outcome | LT_FILES_PREVIOUS parameter will have list of all the files inside DOKNR |
Action Taken | Call FM CVAPI_DOC_CHECKOUTVIEW with importing parameter as OLD_DOKNR. Loop at outcome of Step1 and pass reference of individual FILE through LT_FILES_PREVIOUS_IND. |
Code Snippet | CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW' EXPORTING pf_dokar = DOKAR (Document Type) pf_doknr = OLD_DOKNR pf_dokvr = '00' pf_doktl = '000' pf_ftp_dest = 'SAPFTPA' pf_http_dest = 'SAPHTTPA' pf_content_provide = 'TBL' IMPORTING psx_message = ls_message TABLES pt_files = lt_files_previous_ind ptx_content = lt_drao_ind. |
Outcome | LT_DRAO_IND parameter will have content of individual file which is passed through LT_FILES_PREVIOUS_IND |
Action Taken | Call FM CVAPI_DOC_CREATE with importing parameter as Document Type / Storage Category / TCODE. |
Code Snippet | ls_draw-dokar = DOKAR (Document Type). ls_draw-dokvr = '00'. ls_draw-doktl = '000'. ls_draw-dokst = 'IA'. lv_storage_cat = 'DMS_C1_ST'. ls_api_ctrl-tcode = 'CV01N'. CALL FUNCTION 'CVAPI_DOC_CREATE' EXPORTING ps_draw = ls_draw ps_api_control = ls_api_ctrl IMPORTING psx_message = ls_message pfx_doknr = lv_documentnumber. |
Outcome | Post execution of FM, lv_documentnumber will have newly created DOKNR. |
Action Taken | Loop at DRAO internal table and populate DOKAR/DOKNR/DOKVR/DOKTL with relevent values. Additionally also populate APPNR (Application number) which is available from TABLE parameter "PT_FILES" inside FM CVAPI_DOC_CHECKOUTVIEW. |
Code Snippet | LOOP AT lt_drao_ind ASSIGNING <fs_drao>. <fs_drao>-dokar = DOKAR (Document Type). <fs_drao>-doknr = NEW_DOKNR. <fs_drao>-dokvr = '00'. <fs_drao>-doktl = '000'. <fs_drao>-appnr = ls_files_previous_ind-appnr. ENDLOOP. |
Outcome |
Action Taken | Call FM CVAPI_DOC_CHECKIN with importing parameter as NEW_DOKNR |
Code Snippet | CALL FUNCTION 'CVAPI_DOC_CHECKIN' EXPORTING pf_dokar = DOKAR (Document Type) pf_doknr = NEW_DOKNR pf_dokvr = '00' pf_doktl = '000' ps_api_control = ls_api_ctrl pf_content_provide = 'TBL' pf_ftp_dest = 'SAPFTPA' pf_http_dest = 'SAPHTTPA' IMPORTING psx_message = ls_message TABLES pt_files_x = lt_files_previous_ind pt_comp_x = lt_comp_x pt_content = lt_drao_ind. |
Outcome | Post execution of FM, LT_FILES_PREVIOUS_IND will have new file id created. |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |