FM/BAPI needed to change document status

Hi,
I have a requirement wherein i need to change the document status field in table DRAW. I have document number and document type as input, based on a condition i will be changing the document status. is there any FM or BAPI available to change the document status?
Thanks in advance,
Srilakshmi.

Hi Srilakshmi
The following BAPI could help you,
BAPI Name: Document.SetStatus
Document.SetStatus
Set document status
Functionality
With this method, a new status is set for the document. Optionally, with the help of the field STATUSLOG, one more entry can be made in the status log field.
Notes
The internal or the external status is specified. The internal status defines how the status on the DB is saved; the user can see the external status based on the login language on the screen.
In principle: If the internal status is specified, this has priority, otherwise, the internal status is read via the external status code.
Sample program
**define required variables
DATA: lf_doctype LIKE bapi_doc_draw-documenttype,
lf_docnumber LIKE bapi_doc_draw-documentnumber,
lf_docpart LIKE bapi_doc_draw-documentpart,
lf_docversion LIKE bapi_doc_draw-documentversion,
lf_statusextern LIKE bapi_doc_draw-statusextern,
lf_statusintern LIKE bapi_doc_draw-statusintern,
lf_statuslog LIKE bapi_doc_draw-statuslog.
Bapi-Return structure
DATA: ls_return LIKE bapiret2.
Assign the document data
the status should be changed by this document
lf_docnumber = 'Documentnumber'.
lf_doctype = 'DRW'.
lf_docversion = '00'.
lf_docpart = '000'.
lf_statusintern = 'AR'.
**Call BAPI
CALL FUNCTION 'BAPI_DOCUMENT_SETSTATUS'
EXPORTING: documenttype = lf_doctype
documentnumber = lf_docnumber
documentpart = lf_docpart
documentversion = lf_docversion
statusextern = lf_statusextern
statusintern = lf_statusintern
statuslog = lf_statuslog
IMPORTING: return = ls_return.
Errors occurred ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Regards
S.Sivakumar

Similar Messages

  • My phone has been changed under warranty by the apple store in germany. ı need a change document to register the phone in my country again. ımeı numbers of old and new must be in the document.you can send an mail in pdf format as soon as possible please.

    my phone has been changed under warranty by the apple store in germany.
    ı need a change document to register the phone in my country again.
    ımeı numbers of old and new must be in the document.you can send an mail in pdf format
    as soon as possible please.
    your's respectfully.
    new phone serial no:DQ******TC0
    old phone serial no:DN*******T9Y
    Product:
    iPhone 4S
    Serial Number:
    DN*******T9Y
    Service Requested:
    December 3, 2012
    Status:
    Repair Complete
    <Edited by Host>

    No we cannot send it to you because we are users just like you and Apple does not monitor these forums.
    But you can find the IMEI numbers yourself. Read the ENTIRE article:
    http://support.apple.com/kb/HT4061

  • Just down loaded 10.8.5 and now secret files won't allow me to change document status

    Just down loaded 10.8.5 and now secret files won't allow me to change document status.

    Just down loaded 10.8.5 and now secret files won't allow me to change document status.

  • Need to change the status indicator in CV01n,CV02n and CV03n

    Hi,
        When i am creating the document in CV01n,if the status set to Release then the status indicator need to change in to green.

    Transaction Code - CV01                     Create Document Info Record
    Exit Name           Description
    CV000001            Check-in enhancement for document management
    CV110001            DMS: Enhancements for DMS Dialog (FB: CV110)
    CVDS0001            User exits for ALE DMS (DOCMAS)
    No of Exits:          3
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Rewards if useful.........
    Minal

  • Send e-mail after change document status solar02

    Hi...
    How is possible to send an e-mail for someone or a group, when a especific document status is changed to a new value?
    Thanks in advance,
    Warlei Figueiredo

    Hi Federico,
    Thanks for your tip about how to send an email. So, I am trying to send email in my scenario and I don't know if I am choosing the correct type status. I have two questions:
    1 - In SE16 transaction, into table TJ30 I dont know what transaction type to select?
    2 - Is necessary choose "Depend Partner"? I don't know what kind "Depend Partner" is possible to choose.
    Reminder, my necessity is to send an email to someone (doesn't matter in this moment, could be an especific user your choose) after an specific document into solar02 changed status from "A" to "B".
    Thank you if possible to help me.

  • Authorisation to change document status

    Hello,
    I want to implement a document workflow. A certain user group (asigned to a certain authorisation) is allowed to change the status of a document to "in progress" (this is our own status value). Another group is allowed to assign the status "RELEASED". Is there any authorisation object or standard role that I can use to set up this process?
    Thanks for your answers.
    Best regards,
    Frank

    Hi Frank,
    Please chekc my Blog:
    Solman - Set Up Automatic Confirmation / Changing User Status of Messages using report: AI_SDK_SP_AUTO_CLOSE or AI_SDK_SP_AUTO_CLOSE_2
    Solman - Set Up Automatic Confirmation / Changing User Status of Messages using report: AI_SDK_SP_AUTO_CLOSE_2
    in case of charn:
    1459839:   CRM_SOCM_SERVICE_REPORT: no update on CRMD_ORDER  worklist
    Utility to Change the Status of Solution Manager Change Request Documents
    You can use program CRM_SOCM_SERVICE_REPORT to manually set the next status for a Change Document or Change Request in CHaRM, assuming you have documents that are in an inconsistent state and you cannot change them.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c049fc67-e131-2e10-c991-de6fdee9186b?QuickLink=index&overridelayout=true
    Also this pdf file saved in CHARM folder of my Home share
    Thanks
    regards,
    Vikram

  • Need to change MRP status from Reserved to Fixed - AFS

    Hi,
    I need to change the MRP (allocation) Status (J_3ASTAT) from reserved (R) to Fixed (F).
    transaction  - j4ab
    table - J_3ABDBS (AFS Requirement - Stock assignment) or any other table for this to be updated?
    Do any one have any idea about the Function module or any other procedure to achieve this?
    Thanks,
    Nilanjana

    Hi Nilanjana,
    Yes. You could do this using J4AB.Allocation->Release.
    In the j_3abdbs table, J_3ASTAT field would get changed from "R" to "F".
    The include is /AFS/ARUN_MANAGEMENTTOOL_FCO0Q.
    Best Regards,
    Anitha.

  • Help needed on Changing the Status of a Functional Location

    Hi All,
    After I create a functional location, I have a requirement where in I have to change its status.  E.g., from CRTE to INAC.  Is any there any pre-defined RFC which fulfills this requirement? or Do I have to write any new RFC for changing the status?  Please let me know in detail.
    Also, please let me know how can I set the Deletion flag for a Functional Location?
    Any help is really appreciated.
    Thanks,
    Vijay

    The codes in level_selection.as looks like this, but the problem is I cannot find main_menu_button anywhere, except for main_menu.
    package {
        import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.display.SimpleButton;
        public class level_selection extends Sprite {
            public var main_class:the_game;
            private var level_thumb:level_thumbnail;
            public function level_selection(passed_class:the_game) {
                main_class = passed_class;
                for (var i:int = 1; i<=5; i++) {
                    level_thumb = new level_thumbnail(i,main_class);
                    addChild(level_thumb);
                main_menu_button.addEventListener(MouseEvent.CLICK, on_main_menu_button_clicked);
            public function on_main_menu_button_clicked(event:MouseEvent) {
                main_class.show_splash();

  • BAPI Needed of uploading document in already existing Dispute Case

    Hi,
      I need BAPI for  uploading document in already existing Dispute Case...
    Thanks,
    Ajit

    I tried to use the following program to upload a document and it is not working, any feedback would be helpful:
    *& Report  ZTEMP_DISPUTE_12
    REPORT  ztemp_dispute_12.
    PARAMETER : l_fname TYPE char255.
    DATA : l_file TYPE string,
          lv_xstring  TYPE xstring,
           l_return TYPE  bapiret2,
           l_filecontent TYPE bapiconten,
           i_case TYPE REF TO if_scmg_case_api,
            l_initial_dir     TYPE string,
            l_window_title    TYPE string,
            l_filename_disp   TYPE string,
            l_filename_string TYPE string,
            l_user_action     TYPE i,
            l_rc              TYPE i,
           l_v_lines TYPE i,
           l_mime TYPE skwf_mime,
           l_filelength TYPE i,
           l_component TYPE  bapidoccomp,
           l_skwf_filnm TYPE skwf_filnm,
           li_file_tab        TYPE filetable,
           lwa_file_tab        TYPE file_table,
           li_bin_content  TYPE STANDARD TABLE OF bapiconten,
           l_v_size TYPE i.
    DATA: BEGIN OF itab OCCURS 0,
           line TYPE sdok_sdatx.
    DATA: END OF itab.
    DATA: BEGIN OF i_component OCCURS 0,
            comp_count  TYPE bapipos,
            comp_id     TYPE bapidocid,
            mimetype    TYPE bapimimetype,
            comp_size   TYPE bapipos,
            binary_flag TYPE bapigsbool,
            comp_num    TYPE bapipos.
    DATA: END OF i_component.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR l_fname.
      l_window_title = 'Upload Document'(001).
    Call the file selection dialog
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = l_window_title
          initial_directory       = l_initial_dir
        CHANGING
          file_table              = li_file_tab
          rc                      = l_rc
          user_action             = l_user_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc = 0.
        READ TABLE li_file_tab INTO lwa_file_tab INDEX 1.
        IF sy-subrc = 0.
          l_file = lwa_file_tab-filename.
          l_fname = lwa_file_tab-filename.
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = l_file
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      = itab
    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
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DESCRIBE TABLE itab  LINES l_v_lines.
      l_v_size = l_v_lines * 255.
      l_filename_string = l_file.
      CALL METHOD cl_gui_frontend_services=>file_get_size
        EXPORTING
          file_name = l_filename_string
        IMPORTING
          file_size = l_v_size
        EXCEPTIONS
          OTHERS    = 1.
    convert binary255 to binary1024 table
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = l_v_size
        IMPORTING
          buffer       = lv_xstring
        TABLES
          binary_tab   = itab
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
           rv_failed = 'X'.
           RETURN.
      ENDIF.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer     = lv_xstring
        TABLES
          binary_tab = li_bin_content.
      l_skwf_filnm = l_file.
      CALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'
        EXPORTING
          filename                   = l_skwf_filnm
      X_USE_LOCAL_REGISTRY       =
       IMPORTING
         mimetype                   = l_mime.
      l_component-comp_count    = 1.
      l_component-comp_id       = l_fname.
      l_component-mimetype      = l_mime.
      l_component-comp_size     =  l_v_size.
      l_component-binary_flag   = 'X'.
      l_component-comp_num      = 1.
      APPEND l_component TO i_component.
      DATA:
      lo_case_api TYPE REF TO  cl_scmg_case_api,
       lo_case_api_intf       TYPE REF TO if_scmg_case_api.
      CALL METHOD cl_scmg_case_api=>if_scmg_case_api~open_case
        EXPORTING
          im_case_guid    = 'E99B284FC272B720E100000092D79319'
          im_enqueue      = 'X'
        RECEIVING
          re_case         = lo_case_api_intf
        EXCEPTIONS
          failed          = 1
          enqueue_failed  = 2
          invalid_guid    = 3
          cx_srm_gsp_back = 4
          OTHERS          = 5.
      lo_case_api ?= lo_case_api_intf.
    *DATA : l_if_case_api      TYPE REF TO if_scmg_case_api.
           CALL METHOD cl_scmg_case_api=>open_case
             EXPORTING
               im_case_guid    = 'E99B284FC272B720E100000092D79319'
             RECEIVING
               re_case         = l_if_case_api
             EXCEPTIONS
               failed          = 1
               enqueue_failed  = 2
               invalid_guid    = 3
               cx_srm_gsp_back = 4
               no_authority    = 5
               OTHERS          = 6.
      CALL FUNCTION 'UDM_BD_CREATE_ATTACHMENT'
        EXPORTING
          i_guid      = 'E99B284FC272B720E100000092D79319'              "E99B284FC272B720E100000092D79319
          i_case      = lo_case_api
          i_testrun   = space           " '003A3A4FAD54D97CE100000092D79319'
        TABLES
          bin_content = li_bin_content
          components  = i_component
        CHANGING
          es_return   = l_return.
      IF sy-subrc = 0.
        COMMIT WORK.
      ENDIF.
      CALL FUNCTION 'DEQUEUE_ALL'.
      break 50120i1120.

  • BAPI needed  for  change material(Transaction : MM02)

    Hi all,
    We have a requirement where in we need to post the documents throuh BAPI for change material (Transaction: MM02).
    Any inputs on this..is highly appreciable...
    thanks in advance...
    regards..
    prathima.

    CHECK THIS CODE
    *& Report  ZBAPI_MATERIAL_SAVEDATA
    REPORT  ZBAPI_MATERIAL_SAVEDATA NO STANDARD PAGE HEADING MESSAGE-ID (ZHNC).
    TYPES:BEGIN OF TY_MAT,
           MATERIAL(4),
           IND_SECTOR(1),
           MATL_TYPE(4),
           MATL_GROUP(9),
           BASE_UOM(3),
           BASE_UOM_ISO(3),
           PLANT(4),
           DEL_FLAG(1),
           PUR_GROUP(3),
           BASE_QTY(13),
           STGE_LOC(4),
           MRP_IND(1),
           SALES_ORG(4),
           DISTR_CHAN(2),
           DEL_FLAG1(1),
           MIN_ORDER(13),
           LANGU(2),
          MATL_DESC(40),
       END OF TY_MAT.
    DATA: IT_DATA TYPE TABLE OF TY_MAT,
          WA_DATA LIKE LINE  OF IT_DATA.
    *decalraing flag
    data: v_flag value ''.
    *DECLARING WORK AREAs  TO BE PASSED TO THE FUNCTION MODULE.
    DATA: BAPI_HEAD LIKE BAPIMATHEAD,
          BAPI_CLIENTDATA LIKE BAPI_MARA,
          BAPI_CLIENTDATAX LIKE BAPI_MARAX,
          BAPI_PLANTDATA LIKE BAPI_MARC,
          BAPI_PLANTDATAX LIKE  BAPI_MARCX,
          BAPI_STORAGELOCATIONDATA LIKE BAPI_MARD,
          BAPI_STORAGELOCATIONDATAX LIKE BAPI_MARDX,
          BAPI_SALESDATA LIKE BAPI_MVKE,
          BAPI_SALESDATAX LIKE BAPI_MVKEX,
          BAPI_MAKT LIKE BAPI_MAKT,
          BAPI_RETURN LIKE BAPIRET2.
    *INTERNAL TABLE TO HOLD THE MATERIAL DESCRIPTION
    DATA: BEGIN OF IT_MAKT OCCURS 0.
    INCLUDE STRUCTURE BAPI_MAKT.
    DATA END OF IT_MAKT.
    DATA:BEGIN OF IT_RET OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA END OF IT_RET.
    *INTERNAL TABLE TO HOLD HEADER DATA
    DATA: IT_EXCEL TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *SELECTION-SCREEN ELEMENTS
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER: FNAME TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT 'C:\Documents and Settings\Administrator\Desktop\MATMAS.XLS' .
    PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
                P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
                P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
                P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK B1.
    *DECLARATION OF EXCELAL TABLE
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FNAME.
    PERFORM F_GET_FILE USING FNAME.
    START-OF-SELECTION.
    PERFORM F_XLS_ITAB USING FNAME
                       CHANGING IT_EXCEL.
    PERFORM F_MOVE_DATA.
    perform F_GET_DATA.
    *&      Form  F_GET_FILE
          text
         -->P_FNAME  text
         <--P_SY_SUBRC  text
    FORM F_GET_FILE  USING    P_FNAME LIKE FNAME.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
       PROGRAM_NAME        = SYST-REPID
       DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
      STATIC              = ' '
      MASK                = ' '
      CHANGING
        FILE_NAME           = P_FNAME
    EXCEPTIONS
      MASK_TOO_LONG       = 1
      OTHERS              = 2
    IF SY-SUBRC <> 0.
    MESSAGE E006(ZHNC).
    ENDIF.
    ENDFORM.                    " F_GET_FILE
    *&      Form  F_XLS_ITAB
          text
         -->P_FNAME  text
         <--P_IT_EXCEL  text
    FORM F_XLS_ITAB  USING    P_FNAME
                     CHANGING P_IT_EXCEL.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = FNAME
        I_BEGIN_COL                   = P_BEGCOL
        I_BEGIN_ROW                   = P_BEGROW
        I_END_COL                     = P_ENDCOL
        I_END_ROW                     = P_ENDROW
      TABLES
        INTERN                        = IT_EXCEL
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " F_XLS_ITAB
    *&      Form  F_MOVE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM F_MOVE_DATA .
    DATA : LV_INDEX TYPE I.
    FIELD-SYMBOLS <FS>.
    *--- Sorting the internal table
    SORT IT_EXCEL BY ROW COL.
    CLEAR IT_EXCEL.
    LOOP AT IT_EXCEL.
    MOVE IT_EXCEL-COL TO LV_INDEX.
    *--- Assigning the each record to an internal table row
    ASSIGN COMPONENT LV_INDEX OF STRUCTURE WA_DATA TO <FS>.
    *--- Asigning the field value to a field symbol
    MOVE IT_EXCEL-VALUE TO <FS>.
    AT END OF ROW.
    APPEND WA_DATA TO IT_DATA.
    CLEAR WA_DATA.
    ENDAT.
    ENDLOOP.
    ENDFORM.                    " F_MOVE_DATA
    *&      Form  F_GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_DATA .
    LOOP AT IT_DATA INTO WA_DATA.
    MOVE-CORRESPONDING WA_DATA  TO  BAPI_HEAD.
    BAPI_HEAD-BASIC_VIEW ='X'.
    BAPI_HEAD-SALES_VIEW ='X'.
    BAPI_HEAD-PURCHASE_VIEW ='X'.
    BAPI_HEAD-STORAGE_VIEW ='X'.
    MOVE-CORRESPONDING WA_DATA TO BAPI_CLIENTDATA.
    BAPI_CLIENTDATAX-MATL_GROUP = 'X'.
    BAPI_CLIENTDATAX-BASE_UOM = 'X'.
    BAPI_CLIENTDATAX-BASE_UOM_ISO = 'X'.
    MOVE-CORRESPONDING WA_DATA TO BAPI_PLANTDATA.
    BAPI_PLANTDATAX-PLANT = BAPI_PLANTDATA-PLANT.
    BAPI_PLANTDATAX-DEL_FLAG = 'X'.
    BAPI_PLANTDATAX-PUR_GROUP = 'X'.
    BAPI_PLANTDATAX-BASE_QTY = 'X'.
    MOVE-CORRESPONDING WA_DATA TO BAPI_STORAGELOCATIONDATA.
    BAPI_STORAGELOCATIONDATA-PLANT = BAPI_PLANTDATA-PLANT.
    BAPI_STORAGELOCATIONDATAX-PLANT = BAPI_STORAGELOCATIONDATA-PLANT.
    BAPI_STORAGELOCATIONDATAX-STGE_LOC = BAPI_STORAGELOCATIONDATA-STGE_LOC.
    BAPI_STORAGELOCATIONDATAX-MRP_IND = 'X'.
    MOVE-CORRESPONDING WA_DATA TO BAPI_SALESDATA.
    BAPI_SALESDATAX-SALES_ORG = BAPI_SALESDATA-SALES_ORG.
    BAPI_SALESDATAX-DISTR_CHAN = BAPI_SALESDATA-DISTR_CHAN.
    BAPI_SALESDATAX-DEL_FLAG = BAPI_SALESDATA-DEL_FLAG.
    BAPI_SALESDATAX-MIN_ORDER = 'X'.
    REFRESH IT_MAKT.
    IT_MAKT-LANGU = WA_DATA-LANGU.
    IT_MAKT-MATL_DESC = WA_DATA-MATL_DESC.
    APPEND IT_MAKT.
    CLEAR IT_RET.
    REFRESH IT_RET.
    PERFORM F_CALL_BAPI.
    READ TABLE IT_RET WITH KEY TYPE = 'S'.
    IF SY-SUBRC EQ 0.
    PERFORM F_BAPI_COMMIT.
    WRITE:/ 'MATERIAL CREATED OR UPDATED SUCESSFULLY WITH MATERIAL NO',WA_DATA-MATERIAL.
    ELSE.
    MESSAGE E000(ZHNC) WITH 'ERROR IN CREATING THE MATERIAL'.
    *WRITE: / 'ERROR IN CREATIN MATERIAL',IT_RET-MESSAGE.
    *PERFORM F_DOWNLOAD.
    ENDIF.
    *ENDIF.
    ENDLOOP.
    ENDFORM.                    " F_GET_DATA
    *&      Form  F_CALL_BAPI
          text
    -->  p1        text
    <--  p2        text
    FORM F_CALL_BAPI .
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        HEADDATA                   = BAPI_HEAD
       CLIENTDATA                 =  BAPI_CLIENTDATA
       CLIENTDATAX                =  BAPI_CLIENTDATAX
       PLANTDATA                  =  BAPI_PLANTDATA
       PLANTDATAX                 =  BAPI_PLANTDATAX
       STORAGELOCATIONDATA        =  BAPI_STORAGELOCATIONDATA
       STORAGELOCATIONDATAX       =  BAPI_STORAGELOCATIONDATAX
       SALESDATA                  =  BAPI_SALESDATA
       SALESDATAX                 =  BAPI_SALESDATAX
    IMPORTING
       RETURN                     =  IT_RET
    TABLES
       MATERIALDESCRIPTION        = IT_MAKT
      UNITSOFMEASURE             =
      UNITSOFMEASUREX            =
      INTERNATIONALARTNOS        =
      MATERIALLONGTEXT           =
      TAXCLASSIFICATIONS         =
      RETURNMESSAGES             =
      PRTDATA                    =
      PRTDATAX                   =
      EXTENSIONIN                =
      EXTENSIONINX               =
    APPEND IT_RET.
    ENDFORM.                    " F_CALL_BAPI
    *&      Form  F_BAPI_COMMIT
          text
    -->  p1        text
    <--  p2        text
    FORM F_BAPI_COMMIT .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT         =
    IMPORTING
      RETURN        =
    ENDFORM.                    " F_BAPI_COMMIT

  • Need to change the status of IDOC of type 'INFREC' to 51 failed

    Hi SapAll.
    here i have got a situation  where iam running a sap standard program 'RBDSEINF' tcode'me18'  by filling in parameters "Info record,Merchanise category as INFREC and while running  it is doing some validations using the Function module 'MASTERIDOC_CREATE_INFREC'  through the sap standard Enhancement which is implemented inside it and there is also code written in the EXIT 'EXIT_SAPLMEAO_002' under the include ' ZXMALU03 'to insert some ZSegments,etc.finally after all the explained process it was creating the IDOC Sucessfully.
    now here the requirement is i need to define some code in the following below mentioned FM  to make the IDOC Fail with status 51 when the below mentioned condition  happens
    code in the FM 'MASTERIDOC_CREATE_INFREC'  in the standared enhancement as below :
    FUNCTION masteridoc_create_infrec.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Function Module MASTERIDOC_CREATE_INFREC, Start                                                                                                   A
    *$*$-Start: (1)---------------------------------------------------------------------------------$*$*
    ENHANCEMENT 1  ZRMD_INFOREC_FILTER.
    TYPES: BEGIN OF t_tvkov,
                vkorg TYPE tvkov-vkorg,
                vlgfi TYPE tvkov-vlgfi,
             END OF t_tvkov,
             BEGIN OF t_marc,
                werks TYPE marc-werks,
             END OF t_marc.
    * Variables
      DATA: lv_index TYPE i,
            lv_urzla TYPE eina-urzla,
            lv_matnr TYPE eina-matnr.
    * Tables
      DATA: lt_tvkov TYPE TABLE OF t_tvkov,
            lt_marc  TYPE TABLE OF t_marc.
    * Structures
      DATA: ls_tvkov   LIKE LINE OF lt_tvkov,
            ls_bdieine LIKE LINE OF t_bdieine.
    * Leave only relevant inforecords
      SELECT  SINGLE matnr urzla
        FROM  eina
        INTO  (lv_matnr, lv_urzla)
        WHERE infnr = f_bdieina-infnr.
      IF lv_urzla IS INITIAL.**********************************************************************8
    *    EXIT.
    MESSAGE e019(zrmd_msg).
              TE_IDOC_CONTROL-STATUS ='51'.
             append TE_IDOC_CONTROL.
         ENDIF.*************************************************************************************
    when the above higlited condition is true then i have to create  the IDOC as failed  with the status 51 and with the error message saying 'Country of Origin must be maintained in Purchase info Record”.'
    i have tried debugging for  2 to 3 hours to check if i can create the failed IDOC with status 51 but i couldnt.
    so could any body help me in this.
    regards.
    Varma

    Hi mr  Bhagath.
    the only options where i can get the IDOC Number is as shown in the below attached screen s .
    Varma
    iam not sure of where i can get the IDOC number  and implement the code,the only area where i could get the IDOC number is at the higlited square  block where i explained that i can get but i am not able to write any code there as SAP is not allowing me .
    hope to get the best answer from you.
    regards.
    Varma

  • Need to change status of incident after creating CR

    Hi Experts ,
    I am creating a CR from my incident as folloow up document  from CRMD_ORDER tcode. That is working fine .
    After creating CR i need to change the status of incindent to 'CR created" .
    Means at the time of creating CR i need to change the status of incident .
    1 .Please suggest me where to add code related to update incdent ?
    2 . Can i use ORDER_SAVE badi or any other BADI existed for that ?
    Thanks in advance ,
    Vijay vorsu

    Hi Rajiv ,
    Thnx for quick reply. I am new to CRM .I understood whats to be done.
    I  am following these steps :
    In my CR action profile i am creating a new action called Z_status_change.
    In process type- "permitted process type of action "  i am selecting as ' METHOD CALL" .
    Next i am clicking on "SET PROCESS' .
    Here i am getting problem . When i click on help for on METHOD system is showing existing methods .Here Which method i need to select to change the status .so i thought to create a custom method .
    So i created a BADI Z_STATUS_CHANGE and in attributes of BADI i have given filter type as PPFDFLTVAL .
    I created implementation for this BADI  Z_STATUS_CHANGE_IMP and in attributes in method i have given Z_STATUS_CHANGE .
    But if i search in method in process type of action defination i could not see the method.
    Is the process i am following is right or wrong ?
    If i miss any thing to do pl guide me .
    Thanks in advance ,
    Vijay Vorsu

  • Bapi / Function module to change the status of transaction crmd_order

    Hello team,
    I am developing the utility in CHARM for which i need to change the
    Status of transaction CRMD_ORDER from "New to "In process" through
    report/BAPI / FM etc... I tried to use report
    CRM_socm_service_report.But it never puts status " In process" rather i
    updates only " "work in progress ".
    Also tried FM "CRM_STATUS_CHANGE_EXTERN" , but doen't work.
    After the process is put "In process" , i want to create change request
    and assign resource". Is there any report / FM /Bapi or anything in the
    system to do this.
    I tried to write BDC but dropdown list is not recorded in the recording.
    Please advice.
    Thanks and regards,
    Swapnil

    Not sure I understand your requirement but maybe FM CRM_ORDER_MAINTAIN will be of help to you.

  • Mass Change of Document Status

    Hi.
    We have hundreds of documents in Sol man under the project document tab with a status which we want to change.
    Is there a report or similar that can do a mass change of these statuses?

    Hello,
    there is no standard report for changing document status. We build a new abap for it.
    kind regards,
    Will

  • CJ20N - Change Document Details

    Hi All,
    We need to capture the details of the project and WBS elements in change document tables(CDHDR,CDPOS). Right now when the project is being created and released in the Cj20N then only it captures the change document details in CDHDR table. If I create any project and hit the save option then it is not getting saved in CDHDR table. Even if i add any WBS element in the existing Project and hit the save button the information is not captured in the change document tables. I checked the configuration in SWED, SWEC,SCDO also. But the details are maintained properly. Could any one please guide me how to resolve this issue?
    Regards
    Ram

    HI Madhu,
    I followed the same step which you mentioned and I am able to check the change history. But could you please clarify few points. 1. I am not able to find the change history details of the WBS element in CDHDR under my name when ever I am chaging something or creating new WBS element. 2. The 'I' icon checking and EXTRAS->CHANGE DOCUMENT-> STATUS ALL needs to be done for each and every WBS element that I am creating ? 3. This 'I' con is available for each and every WBS element that I am creating so Do I need to do this for all the WBS element?
    Please advise.
    Regards
    Ram

Maybe you are looking for