Blocking and releasing sales order using FM

Hi experts,
I am in quest of FM that can be used for blocking and releasing SO.i Can do it through t-code VKM3 but my requirement is using FM i want to change the status of SO as block or released.
Can anyone having any idea about this,please share.
Regards,
Pankaj Jain

Hi,
Refer the following post related to sales order releasing enhancements-
How to Release Sales Order
release strategy for sales order?
Sales order release strategy
Hope it helps.

Similar Messages

  • Credit Block for released sales order

    Dear All,
    I have got one issue. There is a sales order which was created earlier say 15 days back. It went into the credit block at the time of saving it. It was released through VKM3 too.
    Now when i change any field in the sales order today, it is going into the credit block. We are not changing any value of any of the item. Just maintaining the Billing block in it or remobving the Billing block.
    The number of days maintained in the OVA8 are 182. So as per the standard functionality it should not go into the credit block for any change in the sales order like changing the billling date or changing the billing block.
    Can you please let me know what might be the reason for this sales order to go into the credit block..??? Any help is very much appreciated.
    Thanks and regards,
    Vishi.

    Dear Vishi
    Please check if you have checked the critical fields option.
    Credit check against critical fields (fixed value dates)
    The indicator controls the critical field check. If the field is selected, the system checks whether critical fields have been changed.
    Use
    If a check is carried out, the following fields are relevant:
    Payment terms
    Additional value days
    Fixed value date
    Note
    Use this type of check for sales documents only.

  • How to check open deliveries and open sales order using means of transport

    Hi,
    I want to check open sales order and open delivries which is having "ABXP" means of transport type .Can anybody suggest me to check in which table or any transa

    means of transport type
    Please reconfirm whether the above statement is correct.  Moreover, you yourself can check at your end by opening any sale order, go to that field, press F1 and press the "Technical Information" icon so that you can see the corresponding table name and field name over there.
    G. Lakshmipathi

  • VKM1 - Release Sales Orders - Job schedueling

    I have maintain automatic credit control for same of the sales documents (the control at the moment checks a review date that should not be in the past, from FD32. If it is in the past it blocks the sales order)
    In the meanwhile, I have maintain a job that runs once a day and releases sales orders if there has been any change in the FD32 of the customer concerning the review date. If there is no change the sales order remains blocked.
    There are though some cases of sales orders that the sales manager regardless of the review date wants to release them. He enters the vkm1 and releases them.
    Up to this point everything is perfect.
    If the sales orders that are released by sales manager using the vkm1 became delivery or invoice before the job schedueling runs there is no problem. If for any reason the sales orders are released by the manager using vkm1 but the next function (delivery or invoice) happens after the job schedueling has run again, the sales order becomes blocked again.
    Is there a way that if the sales order is released by the manager using vkm1 not to become blocked again if the job runs again (so as not to have to release the same sales order more than once)

    I will move this questions to SD

  • Credit Block released Sales order report

    Hi Experts,
    My client is given few sales orders (around 4)no and requesting us, to prepare the credit block released sales orders report (include released person user ID).
    *.No change logs is existing for all sales order and deliveries.
    For above requirement I am using CDHDR table data but I am not getting credit block released sales order report.
    Below fields I am using in CDHDR Table.
    Change doc.Object (objectclas) : VERKBELEG
    Document No (CHANGENR): Sales order no XXXXXXX
    Transaction no (TCODE) : VKM1,VKM2,VKM3
    Date(UDATE) : 25.09.2011 to 09.11.2011
    Experts, Can you please help me out for this.
    Thanking you!!!!
    Regards,
    Vijaykumar Kola
    *.I'm already aware of this is a new development.

    Try this, simple report... Here we check the new value of credit  status field VBUK-CMGST and if it is 'D' we know that someone used VKM* transaction to release the document. Also you need to format the sales order number with leading zeros so it occupies all 10 digits and pass it to CDHDR-OBJECTID field (and not CHANGENR field). In the below code I am using select option for sales order number, so I know it will be formatted with leading zeros and so select on CDHDR will be successful.
    *& Report  ZTV_TEST
    REPORT  ztv_test.
    TABLES: vbak, cdhdr.
    SELECT-OPTIONS: s_saldoc FOR vbak-vbeln OBLIGATORY,
                    s_udate FOR cdhdr-udate.
    RANGES: r_objid FOR cdhdr-objectclas.
    DATA: ls_cdhdr TYPE cdhdr,
          ls_cdpos TYPE cdpos.
    IF NOT s_saldoc IS INITIAL.
      LOOP AT s_saldoc.
        MOVE-CORRESPONDING s_saldoc TO r_objid.
        CONDENSE: r_objid-high, r_objid-low.
        APPEND r_objid.
      ENDLOOP.
    ENDIF.
    CHECK NOT r_objid[] IS INITIAL.
    SELECT *
      INTO ls_cdhdr
      FROM cdhdr
            WHERE objectclas = 'VERKBELEG' AND
                  objectid IN r_objid AND
                  udate IN s_udate AND
                  tcode LIKE 'VKM%'.
      SELECT SINGLE *
        INTO ls_cdpos
        FROM cdpos
          WHERE objectclas = ls_cdhdr-objectclas AND
                objectid = ls_cdhdr-objectid AND
                changenr = ls_cdhdr-changenr AND
                tabname = 'VBUK' AND
                fname = 'CMGST' AND
                value_new = 'D'.
      IF sy-subrc = 0.
        WRITE:/ ls_cdhdr-objectid(10), ls_cdhdr-username,
                ls_cdhdr-udate, ls_cdhdr-utime.
      ENDIF.
    ENDSELECT.

  • Repeat credit check does not happen for already released sales orders when CMGST =D, for the second time using FM SD_ORDER_CREDIT_CHECK

    Hi,
       I have written a routine which will call the FM SD_ORDER_CREDIT_CHECK whenever there is a rejection and again unrejection of a same sales order, we are only concerned about already credit released sales orders, the scenario is as follow
    1). Sales order created in the system --> Credit check --> Credit blocked
    2). Release credit block manually CMGST =D
    3). Reject sales order then unreject the same
    4) Routine will determine rejection and unrejection of the order while saving and will call the FM SD_ORDER_CREDIT_CHECK
    5)   The order is credit checked and blocked if necessary
    All goes well till this point
    but when the same sales order is rejeceted and unrejected multiple times either partially/ fully then the Custom routine calls the FM for credit check but the FM fails to put the order back on credit hold
    in short the FM works only for the first time incase of mutiple rejection and unrejection of teh same sales order then the FM SD_ORDER_CREDIT_CHECK fails to put the order back on credit hold from the second time onwards
    if some one any idea of the behavior of this FM please share your thoughts and inputs . thanks !!

    Issue resolved
    The Standard FM “SD_ORDER_CREDIT _CHECK” uses the field  “Release date of the document determined by credit management  VBAK – CMFRE”
    For any sales order that is manually credit released in a single day, Only one credit check is triggered (per day) if there is any change in the sales order and then the order goes back to credit hold and if again the order is manually credit released for the second time in a single day there will be no credit check  (still the order will pass into FM but  the update entry in the internal table will be blank)this is a standard functionality
    Process of rejection and unrejection :
    Blocked order -->released-->blocked again (first time after manual release same day) unrejected (same day) -->but no credit check  (all this in a single day)
    note : OVA8 - released document still unchecked = 0 Days , Deviation %= blank

  • How to header and item data of sales order using bapi interface

    hi friends,
       i am geetha, i having a problem like how to upload sales oder header and item data through va01 tcode using BAPI FUNCTION MODULES.
    i need bapi function modules for header adn item data  and brief explation on that , how to pass importing and tables  parameters to get exact output .
    regards
    geetha.

    Use : BAPI_SALESORDER_CREATEFROMDAT2
    Sales order: Create Sales Order
    Functionality
    You can use this method to create sales orders.
    You must enter at least sales order header data (via ORDER_HEADER_IN structure) and partner data (via the ORDER_PARTNERS table) as input parameters.
    Enter the item data via the ORDER_ITEMS_IN table. You can allocate item numbers manually, by filling in the relevant fields, or the system does it, according to the settings for Customizing, by leaving the relevant fields blank.
    If you have configurable items, you must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.
    Credit cards can be transferred via the BAPICCARD structure, on the one hand, data for card identification, on the other, data for a transaction which has taken place in an external system.
    Once you have created the sales order successfully, you will receive the document number (SALESDOCUMENT field). Any errors that may occur will be announced via the RETURN parameter.
    If no sales area has been created in the sales order header, then the system creates the sales area from the sold-to party or ship-to party, who has been entered in the partner table. If a clear sales area cannot be created, you will receive a system message, and the sales order will not be created.
    Notes
    1. Mandatory entries:
    ORDER_HEADER_IN : DOC_TYPE     Sales document type
                       SALES_ORG    Sales organization
                       DISTR_CHAN   Distribution channel
                       DIVISION     Division
    ORDER_PARTNERS..: PARTN_ROLE   Partner role, SP sold-to party
                       PARTN_NUMB   Customer number
    ORDER_ITEMS_IN..: MATERIAL     Material number
    2. Ship-to party:
    If no ship-to party is entered, use the following: Ship-to party =
    sold-to party.
    3. Commit control:
    The BAPI does not have a database commit. This means that the relevant application must leave the commit, in order that can be carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is available for this.
    4. German key words:
    The following key words must be entered in German, independantly of
    the logon language:
    DOC_TYPE     Sales document type, for example: TA for standard order
    PARTN_ROLE   Partner role, for example: WE for ship-to party
    Further information
    You can find further information in the OSS. The note 93091 contains general information on the BAPIs in SD.
    Parameters
    SALESDOCUMENTIN
    ORDER_HEADER_IN
    ORDER_HEADER_INX
    SENDER
    BINARY_RELATIONSHIPTYPE
    INT_NUMBER_ASSIGNMENT
    BEHAVE_WHEN_ERROR
    LOGIC_SWITCH
    TESTRUN
    CONVERT
    SALESDOCUMENT
    RETURN
    ORDER_ITEMS_IN
    ORDER_ITEMS_INX
    ORDER_PARTNERS
    ORDER_SCHEDULES_IN
    ORDER_SCHEDULES_INX
    ORDER_CONDITIONS_IN
    ORDER_CONDITIONS_INX
    ORDER_CFGS_REF
    ORDER_CFGS_INST
    ORDER_CFGS_PART_OF
    ORDER_CFGS_VALUE
    ORDER_CFGS_BLOB
    ORDER_CFGS_VK
    ORDER_CFGS_REFINST
    ORDER_CCARD
    ORDER_TEXT
    ORDER_KEYS
    EXTENSIONIN
    PARTNERADDRESSES
    Exceptions
    Function Group
    2032

  • Down Payment processing for Sales orders using Milestone Billing Plan

    Hi,
    The business scenario is as follows.
    The delivery for the sales orders are to be created only after the pre payment( a percentage of the total sales order value) is made by the customer.
    Hence the sales orders while creation are blocked for delivery creation using credit block by means of a userexit.
    The credit manager checks the blocked sales orders using VKM1 transaction and verify if there are any payments made by the customer to cover this pre payment to be made.
    If it is enough to cover then he releases the sales order manually for delivery creation.This is a complex process since there are too many sales orders and the payments made by the customer may not match the amount to be paid(it can be greater or lesser).The customer just pays a huge amount which is to be distributed among the sales orders for pre payments.
    Later, when the invoice is created, the customer account is cleared manually using F-32 transaction for the oldest open invoices.
    Here again there is a huge manual effort involved since he need to distribute the amount against the invoices using oldest open item principle.
    As a solution we are planning to implement "Down Payment processing for Sales orders using Milestone Billing Plan".
    Is this the right solution?
    Can you please give the steps in detail to implement this functionality for above scenario?
    We are using SAP 4.7 version without Project Systems.
    Thanks in advance.
    Regards,
    Ragesh

    Hi Ragesh
    Check the links where you will get the entire down-payment configuration
    [https://forums.sdn.sap.com/post!replydownpayments ]
    Regards
    Srinath

  • Credit block and release Date and time

    Dear All,
    I require a report which can display credit block status date and time and  credit release status date and time for sales order. I have gone through the report RSSCD100 with object class VERKBELEG.It is not fullfilling the requirement as it only display change information.
    If customer has already exceeded the credit limit and new sales order has been generated then this report will reflect its blocked status.
    Kinldy help
    Thank you,
    NoMi

    Hi,
    IF it is not mentioned in single program .
    You can develop a query by using multiple program. Please find the list of programs for CM
    +Reports for Credit Management+
    The following table provides an overview of all the reports available to you in the area of credit
    management
    Program Function
    RFDKLI10 Customers with missing credit data
    This report checks the data for the credit limit for completeness, and produces
    the corresponding error lists. These can be used to re-maintain the
    corresponding definitions manually, or per Batch Input.
    RFDKLI20 Reorganization of credit limit for customers
    This report enables you to reorganize the credit limit information in the control
    areas.
    RFDKLI30 Short overview credit limit
    The report lists the central and control area-related data per customer.
    RFDKLI40 Overview credit limit
    The report provides you with an extensive overview of the customeru2019s credit
    situation.
    RFDKLI41 Credit master sheet
    The credit master sheet enables you to display and print out the customer
    master data for a single account, which is needed for the area of credit
    management.
    RFDKLI42 Early warning list
    The early warning list enables you to display and print out customers in credit
    management, who are viewed as critical customers in the area of credit checks
    in SD.
    RFDKLI43 Master data list
    The master data list enables you to display and print out customersu2019 credit cards.
    In particular, you can display information not contained in the standard system,
    for example, user-defined fields or external data, which you have created with
    specific additonal software.
    RFDKLI50 Mass change credit limit data
    This report allows quick mass change for master data in credit management.
    RFDKLIAB Change display, credit management
    With this report, you can display changes for credit management master data for
    all accounts.
    RVKRED06 Checking blocked credit documents
    The report checks all blocked documents from credit view. The report is started
    in the background, and should run after the incoming payments programs.
    FI/SD - Credit Management/Risk Management SAP AG
    Reports for Credit Management
    RVKRED77 Reorganization credit data SD
    The report enables you to reorganize open credit, delivery and billing document
    values. It is used, for example, when updating errors occur.
    RVKRED08 Checking sales documents which reach the credit horizon
    The report checks all sales documents, which reach the dynamic credit check
    horizon, as new. The report runs periodically, and should run at the start of a
    period. The period for the u2018date of the next credit checku2019 is proposed from the
    current date, with the help of the period split for open sales order values.
    RVKRED09 Checking the credit documents from credit view
    Released documents are only checked if the validity period for the release has
    run out (number days).
    RVKRED88 Simulation reorganization credit data SD
    REgards,
    Krishna O
    Edited by: Krishna O on May 20, 2010 11:30 AM

  • Increase credit limit to release sales order

    Dear
    We are using the dynamic credit control. When one sales order was blocked for exceeding the credit limit.
    Can we increase the credit limit in credit master data(TCODE: FD32), and then sales order will be released automatically, and do not need to use TCODE: VKM1/VKM4 to release the sales order?
    Thank you.
    Guoyu

    Increase Credit Limit through T.Code: FD32
    or
    Release the sales order through T.Code: VKM3
    Regards,
    Rajesh Banka
    Reward points if helpful

  • Credit block in a sales order

    Hi All,
    Is it possible to find out who has released a credit block in a sales order. Is there any table or T-CODE .
    Normally , it is displayed in the Change log of  the sales order . But in our case  the change log is not showing any details of the credit block . Can there be any reason why it is not showed in the Change log .
    Please help .
    Regards,
    Pallavi

    Hi
    Please try this:
    Pass  VBELN to CDHDR table as OBJECTID along with OBJECTCLAS = VERKBELEG To Fetch CHANGENR (Document number) 
    Pass CHANGENR, and VBAK-VBELN, OBJECTCLAS =VERKBELEG, TABNAME=VBAK and FNAME=FAKSK into CDPOS table to
    Fetch CHANGENR
    Pass the CDPOS-CHANGENR as CHANGENR and OBJECTCLAS = VERKBELEG into CDHDR table again to get change details.
    P.S. If sales order was blocked and unblocked by some one, it should display in Change log of sales order.

  • Problem regarding the creation of sales order using bapi.

    Hai all,
    I am creating sales order using bapi but i am, get following error messages :
    TYPE ID  NUMBER MESSAGE
    E       VP   112       Please enter sold-to party or ship-to party
    E       V4   219       Sales document  was not changed
    I have entered all the parameters.
    my program is as follows :
    *& Report  ZSD_SALES_ORDER
    REPORT  ZSD_SALES_ORDER.
        Tables
    *table definitions
    TABLES:vbak,      "Sales Document: Header Data
            knvv,     "Customer Master Sales Data
            mara,     "General Material Data
            t001l,    "Plants/Branches
            mvke,     "Sales Data for Material
            vbap,     "Sales Document: Item Data
            konv.     "Conditions (Transaction Data)
        Types
    *type for upload data
    TYPES :BEGIN OF ty_upload,
           matnr(20) TYPE c,                  " Old material number
           quantity(20) TYPE c,               " Cumulative order quantity in sales units
    VALUE TYPE       BAPIKWERT1,
          value(20) TYPE c,                  " Condition value
                 value TYPE konv-kwert,                  " Condition value
    END OF ty_upload.
    *type for final output table
    TYPES :BEGIN OF ty_main,
               bismt  TYPE mara-bismt,    "Old material number
               matnr  TYPE vbap-matnr,    "Material Number
               kunnr  TYPE vbak-kunnr,    "customer number
               auart  TYPE vbak-auart,    "Sales Document Type
               vkorg  TYPE vbak-vkorg,    "Sales Organization
               vtweg  TYPE vbak-vtweg,    "Distribution Channel
               spart  TYPE vbak-spart,    "Division
               vbeln  TYPE vbak-vbeln,    "Sales document
               werks  TYPE marc-werks,    " Plant
               lgort  TYPE mard-lgort,    "Storage Location
               posnr  TYPE vbap-posnr,    "Sales Document Item
               parvw  TYPE vbpa-parvw,    "Partner function
               kwmeng TYPE vbap-kwmeng,   "Cumulative order quantity in sales units
               kschl  TYPE konv-kschl,    "Condition type
              kwert  TYPE konv-kwert,    "Condition value
    KWERT TYPE       BAPIKWERT1,
              kwert(20)  TYPE c,    "Condition value
               waers  TYPE konv-waers,    "Currency
         END OF ty_main.
    *type for old material number
    TYPES: BEGIN OF ty_matnr,
           matnr TYPE mara-matnr,
           bismt TYPE mara-bismt,
           END OF ty_matnr.
    *type for order number
    TYPES :BEGIN OF ty_output,
           vbeln  TYPE vbak-vbeln,       "Sales Document
         END OF ty_output.
        Constants                Begin with C_                           *
    CONSTANTS:
    c_zpmu(4) TYPE c VALUE 'ZPMU',
    c_zpmm(4) TYPE c VALUE 'ZPMM'.
    DATA: c_ch(1) TYPE c VALUE 'X'.
        Data                     Begin with W_                           *
    *global data for validations
    DATA: w_count TYPE i,
          w_vkorg TYPE vbak-vkorg,
          w_vtweg TYPE vbak-vtweg,
          w_spart TYPE vbak-spart,
          w_werks TYPE t001l-werks,
          w_check TYPE c,
          w_itemno TYPE posnr_va,
         W_COND TYPE C.
          w_cond(3) TYPE c.
        Internal tables          Begin with IT_                          *
    *internal table definitions
    DATA : it_upload TYPE STANDARD TABLE OF ty_upload ,
           wa_upload TYPE ty_upload.
    DATA : it_main TYPE STANDARD TABLE OF ty_main,
           wa_main TYPE ty_main.
    DATA: it_matnr TYPE STANDARD TABLE OF ty_matnr,
          wa_matnr TYPE ty_matnr.
    DATA : it_output TYPE STANDARD TABLE OF ty_output.
    Internal table for BAPI.
    DATA: it_bapisdhd1  TYPE STANDARD TABLE OF bapisdhd1,        "Sales and Distribution Document Header
          wa_bapisdhd1 TYPE bapisdhd1.
    DATA: it_bapisditm  TYPE STANDARD TABLE OF bapisditm ,       "Sales and Distribution Document Item
          wa_bapisditm TYPE bapisditm.
    DATA: it_bapiparnr  TYPE STANDARD TABLE OF bapiparnr,        "SD Document Partner: WWW
          wa_bapiparnr TYPE bapiparnr.
    DATA: it_bapischdl  TYPE STANDARD TABLE OF bapischdl,       "Schedule Lines
          wa_bapischdl TYPE bapischdl.
    DATA: it_bapicond TYPE STANDARD TABLE OF bapicond,       "Communication Fields for Maintaining Conditions in the Order
          wa_bapicond TYPE bapicond.
    DATA: it_bapiret2 TYPE STANDARD TABLE OF bapiret2,        "Return Parameter
          wa_bapiret2 TYPE bapiret2.
          Parameters              Begin with PR_                        *
    *selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME .
    PARAMETERS: pr_vkorg TYPE vbak-vkorg OBLIGATORY,
                pr_vtweg TYPE vbak-vtweg  OBLIGATORY,
                pr_spart TYPE vbak-spart  OBLIGATORY,
                pr_kunnr TYPE kna1-kunnr  OBLIGATORY,
                pr_werks TYPE marc-werks  OBLIGATORY,
                pr_lgort TYPE mard-lgort  OBLIGATORY.
    PARAMETERS: pr_auart TYPE vbak-auart OBLIGATORY,
               PR_AUGRU TYPE VBAK-AUGRU OBLIGATORY.
                            pr_augru TYPE vbak-augru.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.
    PARAMETERS : pr_file TYPE ibipparms-path OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk2.
          At selection-screen                                           *
    AT SELECTION-SCREEN.
      PERFORM f006_validate_vkorg.
      PERFORM f007_validate_vtweg.
      PERFORM f008_validate_spart.
      PERFORM f009_validate_kunnr.
      PERFORM f010_validate_werks.
      PERFORM f011_validate_lgort.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_file.
    *for f4 help----
      PERFORM f003_f4_help.
          S T A R T   O F   S E L E C T I O N                           *
    START-OF-SELECTION.
    *for material ,quantity and value upload
      PERFORM f001_upload_file.
    *get data
      PERFORM  f003_get_data.
    *for check the data
      PERFORM f002_check_data .
      PERFORM f004_process.
    *for posting
      PERFORM f005_posting.
    END-OF-SELECTION.
          E N D       O F   S E L E C T I O N                           *
    *&      Form  f001_upload_file
          upload file
    FORM f001_upload_file .
      DATA : lw_fname TYPE string.
      CLEAR lw_fname.
      lw_fname = pr_file.
      REFRESH it_upload.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lw_fname
          filetype                = 'ASC'
          has_field_separator     = c_ch
        TABLES
          data_tab                = it_upload
        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.
      LOOP AT it_upload INTO wa_upload.
       wa_upload-value = ( wa_upload-value ) / 10.
       MODIFY it_upload FROM wa_upload.
      ENDLOOP.
    ENDFORM.                    "F001_UPLOAD_FILE
    *&      Form  f003_f4_help
          f4 help
    FORM f003_f4_help .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        IMPORTING
          file_name     = pr_file.
    ENDFORM.                    " f003_f4_help
    *&      Form  check_data
          text
    FORM f002_check_data .
      DATA: lw_lines TYPE i.
      DESCRIBE TABLE it_main LINES lw_lines.
      IF lw_lines LE 0.
        RETURN.
      ENDIF.
      SELECT a~matnr
             a~bismt FROM mara AS a INNER JOIN mvke AS b
                   ON amatnr = bmatnr
                   INTO CORRESPONDING FIELDS OF TABLE it_matnr
                   FOR ALL ENTRIES IN it_main
                   WHERE a~bismt = it_main-bismt.
      IF sy-subrc = 0.
        LOOP AT it_main INTO wa_main.
          CLEAR : wa_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY bismt = wa_main-bismt.
          IF sy-subrc = 0.
            MOVE: wa_matnr-matnr TO wa_main-matnr.
          ENDIF.
          MODIFY it_main FROM wa_main TRANSPORTING matnr WHERE bismt = wa_main-bismt.
        ENDLOOP.
      ELSE.
       MESSAGE e000(zmsd) WITH  text-001.
      ENDIF.
    ENDFORM.                    "CHECK_DATA
    *&      Form  F009_validate_vkorg
          text
    FORM f006_validate_vkorg .
      CLEAR w_vkorg.
      SELECT SINGLE vkorg
          INTO w_vkorg FROM tvko
          WHERE vkorg EQ pr_vkorg.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-012 pr_vkorg.
      ENDIF.
    ENDFORM.                    " F009_validate_vkorg
    *&      Form  f007_validate_vtweg
          text
    FORM f007_validate_vtweg .
      CLEAR:w_vtweg.
      SELECT SINGLE vtweg
           INTO w_vtweg FROM tvtw
           WHERE vtweg EQ pr_vtweg.
      IF sy-subrc <> 0.
        MESSAGE e089(zmsd).
      ENDIF.
    ENDFORM.                    " f007_validate_vtweg
    *&      Form  f008_validate_spart
          text
    FORM f008_validate_spart .
      CLEAR:w_spart.
      SELECT SINGLE spart
            INTO w_spart FROM tspa
            WHERE spart EQ pr_spart.
      IF sy-subrc <> 0.
        MESSAGE e087(zmsd).
      ENDIF.
    ENDFORM.                    " f008_validate_spart
    *&      Form  F010_validate_kunnr
          text
    FORM f009_validate_kunnr .
      DATA: l_kunnr TYPE kunnr.
      CLEAR: w_vkorg, w_vtweg,w_spart.
      SELECT  SINGLE  kunnr FROM  knvv
             INTO l_kunnr
             WHERE  kunnr  = pr_kunnr
             AND    vkorg  = pr_vkorg
             AND    vtweg  = pr_vtweg
             AND    spart  = pr_spart.
      IF sy-subrc <> 0.
       MESSAGE e000(zmsd) WITH text-010 pr_kunnr text-011 pr_vkorg  .
      ENDIF.
    ENDFORM.                    " F010_validate_kunnr
    *&      Form  f010_validate_werks
          text
    FORM f010_validate_werks .
      CLEAR:w_werks.
      SELECT SINGLE werks
            INTO w_werks FROM t001w
            WHERE werks EQ pr_werks.
      IF sy-subrc <> 0.
        MESSAGE e088(zmsd).
      ENDIF.
    ENDFORM.                    " f010_validate_werks
    *&      Form  F011_validate_lgort
          text
    FORM f011_validate_lgort .
      CLEAR:w_werks .
      SELECT   SINGLE werks  FROM  t001l
             INTO w_werks
             WHERE  werks  = pr_werks
             AND    lgort  = pr_lgort.
      IF sy-subrc <> 0.
        MESSAGE e000(zmsd) WITH text-007 pr_lgort text-008 pr_werks .
      ENDIF.
    ENDFORM.                    " F011_validate_lgort
    *&      Form  f003_get_data
          text
    FORM f003_get_data .
      CLEAR wa_main.
      REFRESH it_main.
      LOOP AT it_upload INTO wa_upload.
        CLEAR : wa_main.
        MOVE: wa_upload-matnr     TO  wa_main-bismt,
              wa_upload-quantity  TO  wa_main-kwmeng,
              wa_upload-value     TO  wa_main-kwert,
              pr_vkorg            TO  wa_main-vkorg,
              pr_vtweg            TO  wa_main-vtweg,
              pr_spart            TO  wa_main-spart,
              pr_kunnr            TO  wa_main-kunnr,
              pr_werks            TO  wa_main-werks,
              pr_lgort            TO  wa_main-lgort.
        APPEND wa_main TO it_main.
      ENDLOOP.
    ENDFORM.                    " f003_get_data
    *&      Form  f004_process
          text
    FORM f004_process .
    CLEAR w_check.
    LOOP AT it_main INTO wa_main.
       IF wa_main-matnr = ''.
         WRITE:/ text-006,
                     wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF wa_main-kwmeng = 0.
         WRITE:/ text-005,
                 wa_main-bismt.
         w_check = 1.
       ENDIF.
       IF    pr_auart <> 'ZM01'.
         IF wa_main-kwert IS INITIAL.
           WRITE:/ text-004,
                    wa_main-bismt.
           w_check = 1.
         ENDIF.
       ENDIF.
    ENDLOOP.
    ENDFORM.                    " f004_process
    *&      Form  f005_posting
          text
    FORM f005_posting .
      CLEAR: w_itemno,
             w_cond.
      w_itemno = 10.
      w_cond = 1.
    IF w_check = '' OR w_check = 1.
      wa_bapisdhd1-doc_type = pr_auart.
      wa_bapisdhd1-ord_reason = pr_augru.
      LOOP AT it_main INTO wa_main.
        IF w_cond = 1.
          CLEAR: it_bapiret2,
                 it_bapisditm,
                 it_bapiparnr,
                 it_bapischdl,
                 it_bapicond.
          REFRESH:it_bapiret2,
                  it_bapisditm,
                  it_bapiparnr,
                  it_bapischdl,
                  it_bapicond.
          MOVE: wa_main-vkorg TO wa_bapisdhd1-sales_org,
                wa_main-vtweg TO wa_bapisdhd1-distr_chan,
                wa_main-spart TO wa_bapisdhd1-division.
          wa_bapisdhd1-wbs_eleM = 'Y561.1'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT         = pr_kunnr
           IMPORTING
             OUTPUT        = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_S = pr_kunnr.
          wa_bapisdhd1-PURCH_NO_C = pr_kunnr.
        ENDIF.
        MOVE: w_itemno TO wa_bapisditm-itm_number,
               wa_main-matnr TO wa_bapisditm-material,
              wa_main-BISMT TO wa_bapisditm-material,
              wa_main-werks TO wa_bapisditm-plant,
              wa_main-lgort TO wa_bapisditm-store_loc.
                           wa_bapisditm-target_qty = '10'.
        wa_bapisditm-PURCH_NO_S = pr_kunnr.
        wa_bapisditm-PURCH_NO_C = pr_kunnr.
        APPEND wa_bapisditm TO it_bapisditm.
        IF w_cond = 1.
          wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-itm_number = 10.
            wa_bapiparnr-partn_role = 'SP'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          wa_bapiparnr-partn_role = 'AG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'RG'.
          APPEND wa_bapiparnr TO it_bapiparnr.
          CLEAR wa_bapiparnr-partn_role.
                   wa_bapiparnr-partn_numb = pr_kunnr.
          wa_bapiparnr-partn_role = 'WE'.
          APPEND wa_bapiparnr TO it_bapiparnr.
        ENDIF.
        wa_bapischdl-itm_number = w_itemno.
        wa_bapischdl-req_qty    = wa_main-kwmeng.
         wa_bapischdl-PURCH_NO_S = pr_kunnr.
        APPEND wa_bapischdl TO it_bapischdl.
        wa_bapicond-itm_number = w_itemno.
        wa_bapicond-cond_type  = 'ZECL'.
         IF    ( wa_bapisdhd1-doc_type = 'ZPMU' ) OR ( wa_bapisdhd1-doc_type = 'ZPMM' ).
           wa_bapicond-cond_type  = 'ZVAL'.
         ELSE.
           wa_bapicond-cond_type  = 'ZMRP'.       "+PK12122006
         ENDIF.
        wa_bapicond-cond_value = wa_main-kwert.
        APPEND wa_bapicond TO it_bapicond.
        w_itemno = w_itemno + 10.
        w_cond   = w_cond + 1.
      ENDLOOP.
      data : SALESDOCUMENTIN like BAPIVBELN-VBELN.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = wa_bapisdhd1
        IMPORTING
          salesdocument       = SALESDOCUMENTIN
        TABLES
          return              = it_bapiret2
          order_items_in      = it_bapisditm
          order_partners      = it_bapiparnr
          order_schedules_in  = it_bapischdl
          order_conditions_in = it_bapicond.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_ch.
    ENDIF.
      LOOP AT it_bapiret2 INTO wa_bapiret2.
        DATA : w_err(100) TYPE c,
        w_matnr TYPE matnr.
        IF wa_bapiret2-type = 'E' AND wa_bapiret2-id = 'V1' AND wa_bapiret2-number = 392.
          UNPACK wa_bapiret2-message_v1 TO w_matnr.
          READ TABLE it_matnr INTO wa_matnr WITH KEY matnr = w_matnr.
          IF sy-subrc EQ 0.
            CONCATENATE text-013 wa_matnr-bismt INTO w_err SEPARATED BY space.
            MESSAGE w_err TYPE 'S'.
          ENDIF.
        ENDIF.
        IF WA_BAPIRET2-TYPE = 'S'.  " Comment
          WRITE: 40 TEXT-009, WA_BAPIRET2-MESSAGE_V2+0(10).
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " f005_posting
    I have given all the necessary parameters. it is telling that error is in parameter
    sales_header_in.
    I have checked it.
    i have assigned purch_no_s and purch_no_c of the structure BAPISDHD1(ORDER_HEADER_IN)
    in the bapi with customer number.
    and also i have assigned the partnumber of the structure BAPIPARNR ORDER_PARTNERS
    in the bapi with customer number.
    but still , it is diplaying the error message, please enter the sold to or ship to party number.
    how to resolve this error.
    this is urgent requirement.
    points will be awarded.
    thanking u in advance,
    a.srinivas.

    Hi,
    Did u have a look at the standard programs which make use of BAPI_SALESORDER_CREATEFROMDAT1
    Heres a list...
    LWSSOU08                     
    MV45WF0S                     
    MWWMJF21_BAPI_SALESORDER_CREAT
    RBUS2032                    
    Regards,
    Tanveer.
    <b>Please mark helpful answers</b>

  • Releasing Sales Orders from SNP to DP at correct levels

    We have a requirement where we want to do month to date tracking of sales orders in DP compared with the forecast. We have three important characteristics in DP at which we want the data to be released - Product, Location and Customer. Is there a way to release Sales Order data from SNP to DP at such a detailed level ? A product at a location could have sales orders from multiple customers.

    why would you want to send Sales Orders from SNP to DP
    Why not load it into DP planning area through a cube in the DW workbench directly
    As far as i know you can only trasfer from SNP to DP in Product Location (or similar characterstic Level) 
    DP to SNP demand transfer can use descriptive characteristics but dont think you can do it in reverse

  • Repeat credit checking for released sales orders

    Hi,
    We are implementing FSCM Credit management in our project. In our system, when the sales order is created, the credit check will happen and the failed orders will go to VKM1. Till the order is released, any change to that order will trigger the credit checking process.
    But once the credit block is released in VKM1, Credit checking is triggering only for
    Quantity change
    Adding new line items
    Credit checking is not triggering for any other changes to the SO like deleting the line item changing the payment terms etc..
    I would like to know if there is any control in FSCM Credit management to repeat the credit checking process for the released sales orders.
    Appreciate any help in this regard.
    Thanks
    Prabhakar

    Hi Prabhakar,
    Navigate to Financial Supply Chain Management--> Credit Management--> Integration with sales and distribution-->define automatic credit control.
    Over there you need to check critical fields check box for this to happen. Hope this helps

  • Report of recently released sales orders

    Hi,
    Aside from VKM1, is there a standard report that lists down all recently released sales orders (from credit block). Preferably, the report can be listed down by the dates it was released.
    Thanks!

    Hi Mani,
    Thanks for the program name. However, I'm looking for a report that will list all sales orders that has recently been released. I ran the report you specified, and it's limited to the changes done on a particular sales order.
    Thanks!

Maybe you are looking for

  • Saving a SQL query in xml

    I'm writing a program that reads in an xml file that is storing some SQL queries. The user can then select a query and it will run the query on the database and present them with the results. I am running into a problem though and I have narrowed it

  • How to display total for a column in updateble report

    How can I display total on a report column? the query is select htmldb_item.checkbox(1,invoice_id) invoice_id, htmldb_item.DISPLAY_AND_SAVE(2,invoice_no,15)invoice_no, htmldb_item.DISPLAY_AND_SAVE(3,to_char(invoice_date, 'DD-MON-YYYY'),20) invoice_da

  • URL Parameters in Dreamweaver CC

    I have just started using Dreamweaver CC. I'm a long time user of the dynamic data options and have really gotten a lot of usage out of the using Dreamweaver's PHP and ASP functionality. I know that the Server behaviors panel for dynamic data was not

  • URGENT---Validating XML file against DTD

    I have a XML & DTD file.I want to validate that xml file against the specified DTD without using any editor.Through program how can i validate?Pl. help me.It's URGENT.

  • Safari 7.0.4 crash

    Process:     Safari [460] Path:        /Applications/Safari.app/Contents/MacOS/Safari Identifier:  com.apple.Safari Version:     7.0.4 (9537.76.4) Build Info:  WebBrowser-7537076004000000~3 Code Type:   X86-64 (Native) Parent Process:  launchd [173]