BAPI to change invoice document status from deleted to something else

Hi experts,
When the document is deleted thorugh MR8M, the invoice status(rbstat) in rbkp table of the invoice doument(MIRO) change to 2 i.e. deleted.
I want to use the same data for parking again by using standard BAPI_INCOMINGINVOICE_GETDETAIL. But v=before that i have to change the status of the document from deleted to something else
Is there any BAPI exist by which i can change the status (rbstat) from deleted to parking or somthing else. i am trying to change it thorugh BAPI_INCOMINGINVOICE_CHANGE , but its not working.
Please help me to find such BAPI
regards
Mudit

Hi Lan,
you can print with SDK using following code :
ReportLayoutsService oReportLayoutService = SBO_Company.GetCompanyService().GetBusinessService(ServiceTypes.ReportLayoutsService);
ReportLayoutPrintParams oReporPrintParams = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportLayoutPrintParams);
ReportParams oReportParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams);
oReportParam.ReportCode = "QUT1";
DefaultReportParams oReportParaDefault  = oReportLayoutService.GetDefaultReport(oReportParam);
oReporPrintParams.LayoutCode = oReportParaDefault.LayoutCode;
oReporPrintParams.DocEntry = 337;
oReportLayoutService.Print(oReporPrintParams);
I tried to print an unprinted document but it didn't change the printed flag at all ( in / active BP ). So unfortunately it doesn't work.
regards,
Maik

Similar Messages

  • Change database instance name from XE to something else

    Does anyone know how to change the database name during the XE installation?

    Just remember, especially if you are coming from the Microsoft SQL Server or the MySQL world ...
    One MySQL or SQL Server database is roughly one Oracle Schema. You can have any number of Schemas in an Oracle database. It may not be necessary to have a different database name, or multiple XE databases.

  • Change of document posted from MIRO

    Dear experts,
    Is it possible to change the document posted from MIRO?
    I want to put "final invoice" indicator on MIRO document.Users do not have authorization to change the PO(because same indicator exists on PO)  documents.So, i must find solution not done on PO.
    Chris

    Hi,
    you can't change the posted doc...so..
    You need to  cacel/reverse the last posted doc....and create a new doc with the final invoice indicator....
    Go to MIRO --> Choose Cancel invoice doc > enter the last posted doc number or system may also take last by default-> check the mvt type --> execute
    Then go MIRO --> Make new IR doc..
    Hope it helps..
    Regards
    Priyanka.P
    AWARD IF HELPFULL
    Edited by: Priyanka Paltanwale on Sep 4, 2008 8:41 AM

  • EXIT after changing the document status to Parked and complete

    Hi,
    I have an urgent requirement to findout a exit which will trigger after changing the document status to PARKED and COMPLETE. I need this for invoice and FI document.
    I will really appreciate your help.
    Kuntal

    Yes the Workflow Background process completed successfully with no errors. I see the error when I query up the Sales Order go to menu --> Workflow Status -->
    Activity History.
    The Activity History shows error in the Wait Function and the error message is 3001: Invalid command argument.?
    This error message does not explain much. I followed all the steps in document# 397364.1
    Don't know why it should end in error and how it can be fixed?
    Any more ideas?
    Thanks

  • How to change the IDOC Status from 30 to 03

    Hi Friends,
    In the Partner Profiles Collect IDOCS option is Selected and the Output mode is 4.
    In my Custom Program i am Using the Function Module MASTER_IDOC_DISTRIBUTE to generate the IDOCs
    I am getting the IDOCs of Status 30.
    then in my Custom Program, I am Submitting the IDOCs to RSEOUT00 program.
    to change the IDOC status from 30 to 03.
      SUBMIT rseout00 USING SELECTION-SCREEN '1000'
                   WITH docnum  IN  gt_range_idocs
                   WITH p_compl EQ 'Y'
                   AND RETURN.
    but still i am not getting the IDOCs of changed status.
    I need to get the Changed IDOC status and if the IDOC status is not changed then I need to generate an Error file for the IDOCs data and send that data to customers as a mail.
    so my requirment is to call the RSEOUT00 in the Custom Program and Change the IDOCs Status to 03.
      When i am Executing the RSEOUT00 Indidually by giving the IDOCs numbers, then the IDOCs Status is going to change to 03 from 30.
    Kindly Guide me how to proceed furthur
    Thanks in Advance,
    Ganesh

    Thanks Shrishit,
    RC1_IDOC_SET_STATUS changing the Status from 30 to 03.
    Its fine, But my Question is will IDOC Data will be reached to XI Server or not.??
    means is the functionality of this Program is same as the RSEOUT00.
    MY job is to change Status from 30 to 03 only
    and then Check the Status of those IDOCs, and if the IDOC is not sended to XI  i.e.;03 status, then I need to send the Details of IDOC (i.e.; data in filed IDOC) to Customer Mail ID through an Attachement.
    I hope you Understood my AIM, why I need to change the Status in my Custom Program only, by submitting IDOCs to this report .
    Kindly waiting for your reply,
    Thanks in Advance,
    Ganesh

  • Is there any way to change the document size from scene to scene?

    I'm building a portfolio site, but I need the document size to be different from each scene.  I'd rather not create a separate swf/html file for each page since that would disrupt the transition between scenes (not to mention all the wok I went through to get the dropdown menus working).
    For instance, the "home" scene is structured for 1200x670 px, but the portfolio scene labeled "published" needs to be at 1200x1500px.
    Is there any way to change the document size from scene to scene?  OR; If, for instance, I made the universal document size 1200x1500 for the entire flash file, is there a script that would restrict the "home" scene to only show the first 670 pixels?

    not in flash alone.
    you may be able to do what you want using javascript in your html document and using the externalinterface class to communicate between your actionscript the embedding html javascript.

  • How can I change my Developers status from Individual to Company?

    How can I change my Developers status from Individual to Company? Please

    https://developer.apple.com/support/ios/account-management.html

  • I bought a new 5c and transferred from an old update from my iPhone 4.  The only issue I have is the name of my new phone.  How can I change it from Amyiphone4 to something else?

    I bought a new 5c and transferred from an old update from my iPhone 4.  The only issue I have is the name of my new phone.  How can I change it from Amyiphone4 to something else?

    settings - general - about - name - make the changes

  • TS2756 Is there a way to change the name of my hotspot network from iPhone4 to something else?

    I want to change the name of my personal hotspot from iPhone4 to something else.  Is this possible?

    The Personal Hotspot name (SSID) is taken from the name of your phone. So, if you want to change it, change the name of your phone:
    Settings>General>About>Name.

  • How do I change/save the default font in mail from helvetica to something else?

    How do I change/save the default font in mail from helvetica to something else?

    Mail > Preferences > Fonts & Colors > Messages font:
    Click the "Select" button next to "Helvetica 13" textbox.
    Select your choice from the window that opens up.

  • Need a function or bapi to hold invoice document

    Dear All,
    i made a program to read a hold invoice using this function "MRM_INVOICE_READ" is there other functions or bapi doing this job reading hold invoice
    now after i change the data i need to hold the document again what is the best function for this job and i don't want  to park the document

    Hi Ibrahem,
    you can simply use f.m. MRM_INVOICE_READ to read whatever you have already done and held, and then use the f.m. MRM_INVOICE_PARK to save your changes: to avoid really parking the invoice, it is important to specify through the IMPORTING parameter i_rbstat_new the hold status 'D', as shown in the example below:
    park invoice with status 'D' hold
      CALL FUNCTION 'MRM_INVOICE_PARK'
        EXPORTING
          i_rbkpv           = ls_rbkpv
          i_xupda           = 'U'
          i_rbstat_new      = 'D'
          ti_drseg          = lt_drseg
        IMPORTING
          e_belnr           = lv_belnr
          e_gjahr           = lv_gjahr
          te_errprot        = lt_errp
        EXCEPTIONS
          invalid_status    = 1
          update_impossible = 2
          user_exit         = 3
          OTHERS            = 4.
    Best Regards,
    Antonio

  • BAPI to change purchase order to put deletion flag

    Hello Guru's,
            We are about to archive data & for that we need that according to date range all open purchase order ,open purchase requsitions & open RFQ should be marked for deletion.
    Is there some BAPI to do so.Please guide.

    *DELETING FLAG *
    REPORT ZMMR_DELETEPO NO STANDARD PAGE HEADING MESSAGE-ID zisb.
    tables : zvtls_sap.
    *C-- Types Declarations
    TYPES : BEGIN OF tp_flatfile_vtls,
            ebeln(10),
            ebelp type ekpo-ebelp,
            END OF tp_flatfile_vtls.
    *=====================================================================
                      INTERNAL TABLES DECLARATION
    *=====================================================================
    DATA:  t_flatfile_vtls TYPE tp_flatfile_vtls OCCURS 0 WITH HEADER LINE.
    data : begin of t_sapdata occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_sapdata.
    data : begin of t_flatfile_vtls1 occurs 0,
           po(10),
           item like zvtls_sap-itemsap,
           end of t_flatfile_vtls1.
    data : begin of t_update occurs 0,
           mandt like zvtls_sap-mandt,
           povtls like zvtls_sap-povtls,
           itemvtls like zvtls_sap-itemvtls,
           posap like zvtls_sap-posap,
           itemsap like zvtls_sap-itemsap,
           aedat like zvtls_sap-aedat,
           paedt like zvtls_sap-paedt,
           loekz like zvtls_sap-loekz,
           end of t_update.
    data : begin of t_poheader occurs 0,
           po like zvtls_sap-posap,
           end of t_poheader.
    data : begin of t_poitem occurs 0,
           po like zvtls_sap-posap,
           item like zvtls_sap-itemsap,
           end of t_poitem.
    DATA : BEGIN OF T_MESSAGE OCCURS 0,
           MSGTY,
           MSGID(2),
           MSGNO(3),
           MSGTX(100),
           PO like zvtls_sap-povtls,
           item like zvtls_sap-itemvtls,
           END OF T_MESSAGE.
    DATA : BEGIN OF t_bapi_poheader OCCURS 0.
            INCLUDE STRUCTURE bapimepoheader.
    DATA : END OF t_bapi_poheader.
    DATA : BEGIN OF t_bapi_poheaderx OCCURS 0.
            INCLUDE STRUCTURE bapimepoheaderx.
    DATA : END OF t_bapi_poheaderx.
    DATA : BEGIN OF t_bapi_poitem OCCURS 0.
            INCLUDE STRUCTURE bapimepoitem.
    DATA : END OF t_bapi_poitem.
    DATA : BEGIN OF t_bapi_poitemx OCCURS 0.
            INCLUDE STRUCTURE bapimepoitemx.
    DATA : END OF t_bapi_poitemx.
    DATA : BEGIN OF t_bapireturn OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA : END OF t_bapireturn.
    *=====================================================================
                      V A R I A B L E S
    *=====================================================================
    DATA: w_success(6)  TYPE n,
          w_bklas like t023-bklas,
          w_curryear(4),
          w_begda like sy-datum,
          w_endda like sy-datum,
          w_begyr(4),
          w_endyr(4),
          w_currmon(2),
          w_assetclass like ankt-anlkl,
          w_price type p,
          w_recordsap type i,
          w_povtls(10),
          w_count type i.
    DATA:  w_filepath TYPE rlgrap-filename,
           w_rc TYPE sy-subrc,
           w_sscrfields_ucomm1   TYPE sscrfields-ucomm,
           w_file1 TYPE string,
           w_file2 TYPE FILENAME-FILEINTERN.
    *=====================================================================
                      C O N S T A N T S
    *=====================================================================
    CONSTANTS: c_x              TYPE  c         VALUE 'X',
               c_hyp            TYPE  c         VALUE '-',
               c_err            TYPE  bdc_mart  VALUE 'E'.
    CONSTANTS:  c_slash(1)            TYPE c VALUE '/',
                c_hash(1)             TYPE c VALUE '#',
                c_pipe                TYPE c VALUE '|',
                c_1                   TYPE i VALUE 1,
                c_zero                TYPE n VALUE '0',
                c_rg1(3)              TYPE c VALUE 'rg1',
                c_gr3(3)              TYPE c VALUE 'GR3',
                c_gr2(3)              TYPE c VALUE 'GR2',
                c_e(1)                TYPE c VALUE 'E',
                c_filepath(8)         TYPE c VALUE '/interf/',
                c_filetype(10)        TYPE c VALUE 'ASC'.
    CONSTANTS : c_bapimepoheaderx   TYPE x030l-tabname
                                   VALUE 'bapimepoheaderx',
               c_bapimepoitem      TYPE  x030l-tabname
                                   VALUE 'bapimepoitem',
               c_bapimepoaccount   TYPE  x030l-tabname
                                   VALUE 'bapimepoaccount',
               c_t_bapi_poheader(15)        TYPE c
                                            VALUE 't_bapi_poheader',
               c_t_bapi_poitem(13)          TYPE c
                                            VALUE 't_bapi_poitem',
               c_t_bapi_poitemx(14)         TYPE c
                                            VALUE 't_bapi_poitemx',
               c_t_bapi_poheaderx(16)       TYPE c
                                            VALUE 't_bapi_poheaderx'.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    CONSTANTS:con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *======================================================================
                           SELECTION SCREEN
    *======================================================================
    SELECTION-SCREEN BEGIN OF BLOCK inputpath WITH FRAME TITLE text-001.
    SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS : p_fore RADIOBUTTON GROUP rg1
                        USER-COMMAND pc,
                 p_back RADIOBUTTON GROUP rg1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF BLOCK blk2.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-003.
    PARAMETERS :  p_file1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr2.
    PARAMETERS :  p_afile1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr3.
    SELECTION-SCREEN : END OF BLOCK blk1.
    SELECTION-SCREEN END OF BLOCK inputpath.
    *C-- Initialization Event
    INITIALIZATION.
      CLEAR w_filepath.
      CONCATENATE c_filepath sy-sysid c_slash sy-mandt c_slash INTO
      w_filepath.
      CONDENSE w_filepath NO-GAPS.
      p_file1 = text-008.
      p_afile1 = text-009.
    *======================================================================
                           SELECTION SCREEN EVENTS
    *======================================================================
    *C-- Selection Screen Output
    AT SELECTION-SCREEN OUTPUT.
      IF p_fore = c_x.
        w_sscrfields_ucomm1 = space.
      ELSE.
        w_sscrfields_ucomm1 = c_rg1.
      ENDIF.
      LOOP AT SCREEN.
    *C--Modify selection screen if presentation
    *C--or application server radio button is chosen
        IF w_sscrfields_ucomm1 = space.
          IF screen-group1 = c_gr3.
            screen-active = c_zero.
          ENDIF.
        ELSE.
          IF screen-group1 = c_gr2.
            screen-active = c_zero.
          ENDIF.
        ENDIF.
        if screen-name = 'P_AFILE1'.
          screen-input = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    *C-- Selection Screen VALUE-REQUEST FOR File path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      IF p_fore EQ c_x.
        CALL FUNCTION 'F4_FILENAME'
          EXPORTING
            program_name  = syst-cprog
            dynpro_number = syst-dynnr
          IMPORTING
            file_name     = p_file1.
      ENDIF.
    *C-- At Start of the Selection Process
    START-OF-SELECTION.
      IF p_fore EQ c_x.
        w_file1 = p_file1.
      ELSE.
        w_file2 = p_afile1.
      ENDIF.
      IF p_fore EQ c_x. " Presentaion Server
    *C--Validations for the input files
        PERFORM validate_pre_file USING p_file1.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file TABLES t_flatfile_vtls
                            USING w_file1
                            CHANGING w_rc.
        IF w_rc <> 0.
          MESSAGE s006 DISPLAY LIKE c_e.
        ENDIF.
      ELSE. " Application Server
    *C--Validations for the input files
        PERFORM validate_app_file USING  w_file2.
    *C-- Load the contents of the input file into the internal table
        PERFORM upload_file_app TABLES t_flatfile_vtls
                                USING w_file2
                                CHANGING w_rc.
      ENDIF.
      loop at t_flatfile_vtls.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebeln
          IMPORTING
            output = t_flatfile_vtls1-po.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = t_flatfile_vtls-ebelp
          IMPORTING
            output = t_flatfile_vtls1-item.
        append t_flatfile_vtls1.
        clear t_flatfile_vtls1.
      endloop.
      perform get_podata.
      loop at t_poheader.
        perform move_to_bapi.
        perform call_bapi.
      endloop.
      PERFORM STORE_MESSAGES TABLES T_MESSAGE.
    *&      Form  validate_pre_file
        Routine to validate presentation server file path.
         -->fp_name  text
    FORM validate_pre_file USING fp_name TYPE rlgrap-filename.
      DATA : l_result,
             l_filename TYPE string.
      l_filename = fp_name.
      CLEAR l_result.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = l_filename
        RECEIVING
          result               = l_result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc <> 0.
        MESSAGE s007 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ELSEIF l_result IS INITIAL.
        MESSAGE s008 DISPLAY LIKE c_e.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " validate_pre_file_hdr
    *&      Form  validate_app_file
          text - Checks if the path entered and filename is correct
    FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.
      data : l_fname(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
          MESSAGE s007 DISPLAY LIKE c_e.
        ELSE.
          CLOSE DATASET l_fname.
        ENDIF.
      ENDIF.
    ENDFORM.                    " validate_app_file
    *&      Form  upload_file
          Routine to upload data from file to tables.
         -->P_fp_flatfile
         -->P_fp_file
         <--P_fp_rc
    FORM  upload_file TABLES   fp_flatfile
                      USING    fp_file TYPE string
                      CHANGING fp_rc TYPE sy-subrc.
      IF fp_flatfile[] IS INITIAL.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = fp_file
            filetype                = c_filetype
            has_field_separator     = c_x
          TABLES
            data_tab                = fp_flatfile
          EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
        MOVE sy-subrc TO fp_rc.
      ENDIF.
    ENDFORM.  " upload_file
    *&      Form  upload_file_app
          text
         -->FP_FLATFILEtext
         -->FP_FILE    text
         -->FP_RC      text
    FORM  upload_file_app TABLES   fp_flatfile
                          USING    fp_file TYPE FILENAME-FILEINTERN
    CHANGING fp_rc TYPE sy-subrc.
      DATA: l_string TYPE tedata-data.
      DATA: wa_data_file TYPE tp_flatfile_vtls,
            l_wllength TYPE i,
            FNAME(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = FP_FILE
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = 0.
        OPEN DATASET  FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc NE 0.
    *C-- commented by Bikash
         MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.
          message e008.
        ELSE.
          DO.
            CLEAR: l_string.
            READ DATASET  FNAME INTO l_string LENGTH l_wllength.
            IF sy-subrc NE 0.
              EXIT.
            ELSE.
              SPLIT l_string AT con_tab INTO   wa_data_file-ebeln
                                               wa_data_file-ebelp.
              APPEND wa_data_file TO fp_flatfile.
            ENDIF.
          ENDDO.
          CLOSE DATASET  FNAME.
        ENDIF.
      ENDIF.
    ENDFORM.  " upload_file_app
    *&      Form  get_podata
          text
    form get_podata.
      select *
      into table t_update
      from zvtls_sap
      for all entries in t_flatfile_vtls1
       where itemvtls = t_flatfile_vtls1-item
      and povtls = t_flatfile_vtls1-po.
      sort t_update by posap itemsap.
      loop at t_update.
        at new posap.
          t_poheader-po = t_update-posap.
          append t_poheader.
          clear t_poheader.
        endat.
        t_poitem-po = t_update-posap.
        t_poitem-item = t_update-itemsap.
        append t_poitem.
        clear t_poitem.
        t_update-paedt = sy-datum.
        t_update-loekz = 'X'.
        modify t_update.
      endloop.
      modify zvtls_sap from table t_update.
    endform.                    "get_podata
    *&      Form  move_to_bapi
          text
    form move_to_bapi.
      t_bapi_poheader-po_number = t_poheader-po.
      CLEAR t_bapi_poheaderx.
      PERFORM fill_check_structure USING c_bapimepoheaderx
                                         c_t_bapi_poheader
                                         c_t_bapi_poheaderx
                                         c_x.
      refresh : t_bapi_poitem,t_bapi_poitemx.
      loop at t_poitem where po = t_poheader-po.
        clear t_bapi_poitem.
        t_bapi_poitem-po_item = t_poitem-item.
        t_bapi_poitem-delete_ind = 'X'.
        CLEAR t_bapi_poitemx.
        PERFORM fill_check_structure USING c_bapimepoitem
                                           c_t_bapi_poitem
                                           c_t_bapi_poitemx
                                           c_x.
        t_bapi_poitemx-po_item = t_poitem-item.
        t_bapi_poitemx-po_itemx = c_x.
        APPEND t_bapi_poitem.
        APPEND t_bapi_poitemx.
        clear t_bapi_poitem.
        clear t_bapi_poitemx.
      endloop.
    endform.                    "move_to_bapi
    *&      Form  call_bapi
          This form Routine is used to commit the data records
    FORM call_bapi .
      DATA : l_msgty      TYPE c,
             l_msgid(2)   TYPE c,
             l_msgno(3)   TYPE c,
             l_msgtx(100) TYPE c,
             l_errflag    TYPE c.
      CLEAR: t_bapireturn.
      REFRESH: t_bapireturn.
      *CALL FUNCTION 'BAPI_PO_CHANGE'*
        EXPORTING
          PURCHASEORDER = T_POHEADER-PO
          POHEADER      = T_BAPI_POHEADER
          POHEADERX     = T_BAPI_POHEADERX
        TABLES
          RETURN        = T_BAPIRETURN
          POITEM        = T_BAPI_POITEM
          POITEMX       = T_BAPI_POITEMX.
      READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
      IF sy-subrc NE 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_x.
      ENDIF.
    *C-- Write messages
      WRITE: / 'PO Number', t_poheader-po.
      clear : t_update,w_povtls.
      read table t_update with key posap = t_poheader-po.
      w_povtls = t_update-povtls.
      CLEAR l_errflag.
      LOOP AT t_bapireturn.
        CLEAR: l_msgty, l_msgid, l_msgno, l_msgtx.
        l_msgty = t_bapireturn-type.
        l_msgid = t_bapireturn-id.
        l_msgno = t_bapireturn-number.
        l_msgtx = t_bapireturn-message.
        WRITE: / l_msgty, l_msgid, l_msgno, l_msgtx.
        if l_msgtx cs t_poheader-po.
          w_count = w_count + 1.
          loop at t_update.
            if sy-tabix = w_count.
              t_message-item = t_update-itemvtls.
            endif.
          endloop.
        endif.
        t_message-msgty = l_msgty.
        t_message-msgid = l_msgid.
        t_message-msgno = l_msgno.
        t_message-msgtx = l_msgtx.
        t_message-po = w_povtls.
        append t_message.
        clear t_message.
        IF l_msgty EQ c_err.
          l_errflag = c_x.
        ENDIF.    " l_msgty EQ 'E'
      ENDLOOP.
      ULINE.
      IF l_errflag NE c_x.
        w_success = w_success + 1.
      ENDIF.    " l_errflag NE C_X
    endform.                    "call_bapi
    *&      Form  fill_check_structure
          This form Routine will check whether the specified structure
          exist/active
    FORM fill_check_structure  USING    fp_tabname TYPE any
                                        fp_orgtabname TYPE any
                                        fp_chktabname TYPE any
                                        fp_check TYPE c.
      FIELD-SYMBOLS : <fs_chk>, <fs_org>.
      DATA:    l_char1(61)  TYPE c,
               l_char2(61)  TYPE c.
      DATA:    BEGIN OF tl_nametab OCCURS 60.
              INCLUDE STRUCTURE x031l.
      DATA:    END OF tl_nametab.
      REFRESH tl_nametab.
      CALL FUNCTION 'RFC_GET_NAMETAB'
        EXPORTING
          tabname          = fp_tabname
        TABLES
          nametab          = tl_nametab
        EXCEPTIONS
          table_not_active = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
        CLEAR tl_nametab.
      ENDIF.
      LOOP AT tl_nametab.
        CLEAR: l_char1, l_char2.
        CONCATENATE fp_chktabname c_hyp tl_nametab-fieldname INTO l_char1.
        ASSIGN (l_char1) TO <fs_chk>.
        CONCATENATE fp_orgtabname c_hyp tl_nametab-fieldname INTO l_char2.
        ASSIGN (l_char2) TO <fs_org>.
        IF <fs_org> IS NOT INITIAL.
          <fs_chk> = fp_check.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " fill_check_structure
    *&      Form  STORE_MESSAGES
          text
         -->FP_MESSAGEStext
    FORM STORE_MESSAGES TABLES FP_MESSAGES STRUCTURE T_MESSAGE.
      DATA: wl_output_data LIKE t_MESSAGE.
      DATA: l_catstr TYPE string.
      DATA: l_fieldvalue TYPE string.
      DATA: l_index TYPE i VALUE 1.
      DATA: L_FNAME(60).
      FIELD-SYMBOLS <fs>.
      CLEAR l_catstr.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = '/USR/SAP/VTLS/POCHANGE/LOG'
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC = '0'.
        IF fp_messages[] IS NOT INITIAL.
          OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc NE 0.
            LEAVE LIST-PROCESSING.
          ELSE.
            LOOP AT fp_messages INTO wl_output_data.
              DO.
               ASSIGN COMPONENT l_index OF STRUCTURE wl_output_data TO <fs>.
                IF sy-subrc <> 0.
                  EXIT.
                ENDIF.
                MOVE <fs> TO l_fieldvalue.
                IF l_catstr IS NOT INITIAL.
                  CONCATENATE l_catstr l_fieldvalue INTO l_catstr SEPARATED
                  BY con_tab.
                ELSE.
                  MOVE l_fieldvalue TO l_catstr.
                ENDIF.
                l_index = l_index + c_1.
                CLEAR l_fieldvalue.
                CLEAR <fs>.
              ENDDO.
              l_index = c_1.
              TRANSFER l_catstr TO L_FNAME .
              CLEAR wl_output_data.
              CLEAR l_catstr.
            ENDLOOP.
            CLOSE  DATASET L_FNAME.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "STORE_MESSAGES

  • Is it possible to change marketing document status in DI?

    Hi,
    It seems that the document status and printed status is readonly properties in DI. I need to change these two status in my AddOn. Does that mean that I can only use SQL UPDATE to update the document status ?
    Thanks!
    Lan

    Hello
    Yes you see well, these statuses are read only by DI API, because these statuses are managed using business operations
    like: printed -. you need to print the document
    - closed : you need to close the document
    - cancelled : you need to cancel the document
    >Does that mean that I can only use SQL UPDATE to update the document status ?
    No never. For example: you have a sales order. This sales order is has affect in Item Master data, increasing the iscommited quantity.
    Now if you update by SQL, the iscommited qty does not reduced, so you make data inconsistency in the Business Logic of SAP B1.
    You can do the following:
    you may print the document to a dummy printer (PDF creator printer) to get it printed .-> use UI API to print
    you may use .Close(), .Cancel methods of DI API on a document to make the status closed/cancelled. Please note, Cancel and Close not able to eliminate on each documents (eg invoices is not implemented).
    regards
    János

  • How to change the user status from CJ01 transaction

    Hello All,
    I am doing a BDC in CJ01 transaction where there is a field called "User Status" .
    This field is not editable. However the requirement is to populate this field with some value based on some other entries.
    Is there any Function module / BAPI to update user status from CJ01.
    Thanks in advance.
    Regards
    Indrajit

    Hi Anbu
        Thanks for your kindness.
         I had got the proper badi definition ( RECN_CONTRACT ) before. I have try to implement the badi in my implementation YCL_IM_RECN_CONTRACT and below is my example codes. It can update the user status when the SAVE button is pressed. My example codes are below:
    METHOD if_ex_recn_contract~check_all.
      DATA:
          cl_recn_contract   TYPE REF TO cl_recn_contract.
      DATA: r_status_mngr TYPE REF TO if_reca_status_mngr.
      DATA: lv_status_profile TYPE j_stsma.
      DATA: lt_status TYPE re_t_status,
                ls_status TYPE LINE OF re_t_status.
      DATA: r_message TYPE REF TO if_reca_message_list.
      cl_recn_contract ?= io_object.
      CHECK if_before_store = 'X'.
      CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->get_current_status
        IMPORTING
          ed_status_scheme = lv_status_profile
          et_status        = lt_status.
      lv_status_profile = 'ZBCIA01'.
      CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->set_status_profile
        EXPORTING
          id_status_profile = lv_status_profile.
      READ TABLE lt_status INTO ls_status INDEX 2.
      ls_status-stat = 'E0001'.
      ls_status-inact = ''.
      MODIFY lt_status FROM ls_status INDEX 2.
       CALL METHOD cf_reca_message_list=>create
         RECEIVING
           ro_instance = r_message.
      CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->set_status
        EXPORTING
          it_status           = lt_status
          if_only_user_status = 'X'
          io_msglist          = r_message.
      REFRESH lt_status.
    ENDMETHOD.

  • Changing Invoice document date

    Hi All,
    There is an invoice document which is posted on 27.01.2009 and has an incorrect document date ( 20.01.0009).
    Is there a way we can change the document date? i tried looking for SAP Note but was unable to find any..
    Appreciate any help ..
    Thanks & Regards

    Dear,
    nevertheless the System allows You to insert:
    BKPF-BLDAT            Document Date
    BKPF-BUDAT            Posting Date
    into table v_tbaer by sm31,
    then You will never be able to change these datas for data consistency by FB02.
    You have to reverse the wrong document and post it again.
    I'd suggest for the future to build up an FI validation to control these dates in order to avoid the user to do the error again.
    I hope this helps.
    Mauri

Maybe you are looking for