MB_CREATE_GOODS_MOVEMENT returning EMKPF-SUBRC = 5

Hi Guys,
Need help............!!!!!!!!!!!!!!!!!!!!!!!!!!
We are unable to delete the service entry sheet(SES) due to error message "Deficit of PU GR quantity 13 ACT" in ML81 tcode.
We found that the "Quantity Received" field under quantity tab is not updated in GR document(Mov Type 101) of SES. So, could you please suggest how to update the quantity received in the GR document. After doing this then only we can delete the SES.
We have debuggued the ML81N transaction and in this we found that function module "MB_CREATE_GOODS_MOVEMENT" is returing error EMKPF-SUBRC = 5(Where 5 indicates "No item generated").
Thanks in advance,
vinod

Thanks for the reply.
No. We have not posted.

Similar Messages

  • MB_CREATE_GOODS_MOVEMENT returning subrc = 5

    Hiii guyz...
    Need some help up here ...
    In the below code ..we were calling these FMs to create and post goods movement.Here I have made a lill change,  initially we were passing MIGO in parameter now I am passing MIGO_GO and now FM is returing subrc = 5 instead of 1. No other parameter has been changed.
    v_imkpf-budat     = budat.
      v_imkpf-bldat     = bldat.
      v_imkpf-pr_print  = migo_elikz.
      v_imkpf-wever     = wever.
      v_imkpf-weverx    = weverx.
      v_imseg-global_counter = v_imseg-aufps
                             = v_imseg-posnr
                             = v_imseg-line_id
                             = 1.
      v_imseg-called_by      = 'MIGO_GO'.  "Change of Jahan
      v_imseg-bwart          = bwart.
      v_imseg-matnr          = matnr.
      v_imseg-werks          = werks.
      v_imseg-lgort          = lgort.
      v_imseg-charg          = charg.
      v_imseg-kzbew          = kzbew.
      v_imseg-menge          = v_imseg-erfmg
                             = erfmg.
      v_imseg-meins          = v_imseg-erfme
                             = erfme.
      v_imseg-migo_elikz     = migo_elikz.
      v_imseg-lgnum          = lgnum.
    v_imseg-hsdat          = hsdat. 
      v_imseg-aufnr          = aufnr.
      v_imseg-bukrs          = bukrs.
      v_imseg-weanzx         = weanzx.
      v_imseg-wempfx         = wempfx.
      v_imseg-abladx         = abladx.
      APPEND v_imseg TO t_imseg.
      CALL FUNCTION 'MB_CREATE_GOODS_MOVEMENT'
        EXPORTING
          imkpf = v_imkpf
          xallp = 'X'
          xallb = 'X'
          xallr = 'X'
          ctcod = 'MIGO_GO'      "Change of Jahan
        IMPORTING
          emkpf = v_emkpf
        TABLES
          emseg = t_emseg
          imseg = t_imseg.
      IF v_emkpf-subrc = 1.
        CALL FUNCTION 'MB_POST_GOODS_MOVEMENT'
          IMPORTING
            emkpf = v_emkpf.
      ELSE.
    I tried to dubug , but couldnt figure out any thing.
    Any ideas experts ..!
    Thanks
    Jahan.

    Hi ,
          Please check in table T158B is MIGO_GO entry with a movement type you passing has been maintained or not .
    If you read the documenattion of FM MB_CREATE_GOODS_MOVEMENT  for the Input CTCOD it mentions that entry should be in table T158 and T158B For the Transaction code you are passing .
    Please reward if useful.

  • AUTHORITY-CHECK always Return sy-subrc 0

    Hi,
    I have created a Authorization Object  'ZAUTH_ATCH' and created Roles also. This role is assigned to only my Userid.
    When in Report program I do a check:
    AUTHORITY-CHECK OBJECT 'ZAUTH_ATCH'
             ID 'USER' FIELD l_syuname .
    But the AUTHORITY-CHECK return 0 for all User IDs.
    Pls help what could be the Issue.
    Thanks
    Mohammed

    Hi,
    May be you would need to change the auth object and add the following two fields:
    REPID        ABAP Program Name
    ACTVT      Activity
    allowed values for ACTVT :
                                 01     Create or generate
                                 02     Change
                                 03     Display
                                 16     Execute
    In the code you can check
    AUTHORITY-CHECK OBJECT   "OBJECT_NAME"
                          ID   'ACTVT'  FIELD '16'.
                          ID   'REPID'  FIELD sy-cprog.
    Hope it helps.
    Anju

  • MB_CREATE_GOODS_MOVEMENT with & without Item text

    Hi Experts,
    I am using MB_CREATE_GOODS_MOVEMENT to create GR.
    for plant A I have a set of data, which does not have Item text , I find GR is created successfully.
    For plant B, I have another set of data , which does not have Item text(MSEG-SGTXT). GR is not created here.
    In the debugger, if have enter item text, GR gets created.
    I am analysing why is this behaving differently for 2 different data. I dint get any clues yet. Please share your thoughts on this.
    Thanks for your suggestions,
    Seema.

    Hi vinod,
    EMKPF subrc is 5. and EMSEG has
    VBELN     C     10      005298624
    MBLNR     C     10                                                                               
    MJAHR     N     4      0000
    BWART     C     3      Z10
    MSGID     C     20      M7
    MSGNO     C     3      093
    MSGTY     C     1      E
    MSGV1     C     50      Z10
    MSGV2     C     50      35509999
    MSGV3     C     50      Text
    MSGV4     C     50      002
    I am checking the reason for this error. In case you have idea, please share.
    Edited by: M.Seema on Jun 4, 2010 3:24 PM

  • Open Dataset for XML not reading the XML file, Returning Code 8.

    Dear all,
    Im trying to open an XML file using Open Dataset, since i have to execute this report in background and GUI_upload doesnt work in background.
    The XML file is available in my C:\, say, C:\xmlfile.xml.
    But  the open dataset is not reading any value into the g_xml_line . it is returning sy-subrc = 8.
    Below is my code for that, can anybody help me out to resolve.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_input.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc ne 0.
        WRITE:/ 'invalid file'.
      else.
      DO.
        READ DATASET lv_filename INTO  g_xml_line.
        IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_filename.
       ENDIF.
    TYPES: BEGIN OF t_xml_line,
            data(256) TYPE x,
          END OF t_xml_line.
    DATA: g_xml_table       TYPE TABLE OF t_xml_line,
          g_xml_line        TYPE t_xml_line,
          g_xml_table_size  TYPE i.
    GET REFERENCE OF gt_person INTO gs_result_xml-value.
      gs_result_xml-name = 'IPIX'.
      APPEND gs_result_xml TO gt_result_xml.
    Perform the XSLT stylesheet
      TRY.
          CALL TRANSFORMATION zaum_manh_sync_rpt
          SOURCE XML g_xml_table
          RESULT (gt_result_xml).
        CATCH cx_root INTO gs_rif_ex.
          gs_var_text = gs_rif_ex->get_text( ).
          MESSAGE gs_var_text TYPE 'E'.
      ENDTRY.
    Kindly suggest me a solution. Points assured
    regs,
    raja

    After saving the file , below is the code i wrote, but it gives a runtime error with message
    No roll storage space of length 3788808 available for internal storage.
    ***Coding****
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/DEV/SYS/global/XMLABAP2.XML'.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_file.
      DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_file
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    */usr/sap/DEV/SYS/global/substanc
      lv_filename = l_fname.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        WRITE:/ 'invalid file'.
      ELSE.
        DO.
          READ DATASET lv_filename INTO  g_xml_line.
       IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
       ELSE.
         EXIT.
       ENDIF.
        ENDDO.
        CLOSE DATASET lv_filename.
      ENDIF.

  • GUI_DOWNLOAD issue - returns empty table

    I am using the following to read a text file (I have tried a tab delimited text file as well as a .csv file) into an internal table.  The returned sy-subrc value is 0 but the returned table is empty.
    Any ideas?
    Regards,
    Davis
    d_string = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = d_string
    *   FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
        TABLES
          data_tab                        = it_string
    *   FIELDNAMES                      =
       EXCEPTIONS
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         OTHERS                          = 22

    Arent you supposed to use GUI_UPLOAD?
    GUI_UPLOAD - Text file to internal table.
    GUI_Download - Internal table to text file.

  • Output is successfully triggered even after setting SY-SUBRC = 4 in Routine

    Hi All,
    My requirement is to set the processing status for a output type  [which generates an IDoc]  as Error for the transaction VT02n in case the Shipment Satisfies a particular condition.
    In order to implement the requirement ,I have created a requirment routine using VOFM transaction where the required condition is checked successfully. The Routine returns SY-SUBRC as 4 , but the output type is still successfully processed .
    I have also added the routine number in the procedures section  of the NACE transaction.
    Is there any other configuration required in order to fulfill the requirement?
    Thanks in advance.
    Best regards,
    Souvik

    Hello Brad,
    Thanks for your reply .
    I the output analysis log of the output type, the many output types are displayed but the output type output type which was triggered shows that the requirement 999 was to fulfilled . But the processing log shows that the I DOC has been generated.
    Could you please let me know which portion of the standard code do I need to re implement the code in requirement routine.
    At present , I have pasted the code at the beginning of ALE_PROCESSING form which gets triggered when I DOC is triggered with the condition of the transaction and output type. The code sets the RC value 1 and exits the form if certain condition is satisfied.
    The result is as expected . The I DOC is not triggered.
    Is this the portion where you suggested to re implement the code?
    Regards,
    Souvik

  • Getting error in BADI

    hi,
    Here is my reqirement:
       The SAP sales BOM functionality needs to generate movement types 309/310 rebrands for the component materials and 601 on the header or additized material. This is needed to create the correct financial posting as well as stock movements
    When the  header MOT of the delivery for PK as well as the item category of the sales BOM header ZTAQ.Business Ad-In ‘LE_SHP_GOODSMOVEMENT’ can be used to trigger the goods movement from the delivery.
    for cretetion of materila document i have used the FM
    BAPI_GOODSMVT_CREATE .bUT Iam getting an error msg "<b>No additional quantities imported from external application"</b>.Please explain me wht the error is?
    Thanks

    Hi,
         Instead of BAPI_GOODSMVT_CREATE.Use <b>MB_CREATE_GOODS_MOVEMENT</b>.
    The function module provides a general interface for posting goods movements.
    Movements performed in the framework of subcontracting (e.g. goods receipt for vendor with reference to subcontract order item or subsequent adjustment of "material to be provided" items) are currently not supported.
    In addition, it is assumed that in a goods movement with reference to a reservation, the reservation has already been read. The data of the reservation is to be made available through IMSEG. As of Release 3.0D, it is also possible to only submit the reservation number and item. In this case, the field XRERE of structure IMSEG must be filled with 'X'. If a reversal with reference to a reservation is to be posted - and the XRERE indicator set -, the XSTOB field in the IMSEG structure must be filled with X. In this case, no value is submitted in the IMSEG-BWART field.
    As of Release 3.0D, it is possible to have the system suggest the quantity to be posted. This has been implemented for movements with reference to reservations, production orders, and purchase orders. Enter an 'X' in the field IMSEG-XMEVO. The field IMSEG-ERFMG must remain blank.
    The system uses either the SY-TCODE or the transaction code that has explicitly been provided in the import parameter CTCOD. You have to make sure that an entry for the transaction is contained in table T158. In addition, you have to maintain the transaction/valid movement type combination in table T158B.
    There is no dialog. That is, error handling has to be ensured by the caller. The function module has been designed so that new items can only be added at the end. They cannot be inserted at any other point, because then the correct allocation between IMSEG and EMSEG will be lost (via SY-TABIX). The error messages are returned to the caller via the structure EMKPF or EMSEG. The COMMIT occurs at the caller.
    The parameter XALLP controls that the material document can only be generated after all items have been posted. Parameter XALLR controls whether in the case of repeated calls all tables are to be initialized or only the new/corrected items are to be processed. If in the calling program, new items are inserted between existing items, this parameter must be set.
    There is also the following option: Items that caused an error in the first call can be omitted when repeating the call. For this purpose, the field XNIBU in table IMSEG must be set.
    The structure EMKPF and tables IMSEG and EMSEG are returned. The field IMSEG-BEAKZ indicates when processing of an item was successful. In the field EMSEG-YZEIL, the preliminary line number is contained in the material document. If the document is posted, the line number is contained in field EMSEG-MBLPO of the material document. The field EMKPF-SUBRC indicates where the program found the error.
    EMKPF-SUBRC          Ereror
    16               Initialization incorrect
    15              Header data incorrect
    11              Error when reading material master records per PREFETCH
    10              Error when reading material short texts per PREFETCH
    08              Allocation of IMSEG to EMSEG incorrect
    07              Error when correcting an item
    06              Error when creating an item
    05              No item generated
    04              It is only permitted to post all items; however, there
                        is at least one incorrect item
    03              Error when posting the document
    02              Allocation of IMSEG to EMSEG incorrect
    01              Allocation of YMBUZ to XMSEG incorrect
    Please note that in EMKPF, the message ID, message number, etc. need not necessarily be set. It can also be the case that the system only indicates that an error has occurred. However, the relevant error message can be found in table EMSEG (with reference to the relevant line). For the following EMKPF-SUBRC's, the error messages are contained in table EMSEG: 07, 06, 05, 04.
    Regards

  • Short Dump in MIGO transaction

    When executing the transaction MIGO the transaction ends with the short dump as follows.
    is it because of SAPNOTE 385830 ?
    short text of error message : GET_SYTEM_BUSINESS_ERROR An error occurred while determining the business system ( No_business_system)
    Technical information of error message
    messgae class 00
    number 001
    variable 1 GET_SYTEM_BUSINESS_ERROR An error occurred while
    variable 2 determining the business system ( No_business_system)
    T CODE : migo
    PROGRAM  : SAPLMBWL
    sceen no saplmigo 0001
    screen line 18
    the dump occurs at the line marked with -
    >.
    function mb_post_goods_movement.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(XBLNR_SD) OPTIONAL
    *"  EXPORTING
    *"     VALUE(EMKPF) LIKE  EMKPF STRUCTURE  EMKPF
       data: l_mem_id(10) type c.                                   " 641365
    Wurde zuvor eine Lieferung erzeugt, so ist kein MB_POST... nötig "HUM
       check not xdeliv = x.                                            "HUM
    Control posting for external WM: Exit if BFWMS = 1 (Create delivery)
       check not mkpf-bfwms = 1.                                     "357661
       read table xmseg index 1.
       if not sy-subrc is initial.
         message a260.
       endif.
       if xmkpf-mblnr is initial.
         message a260.
       endif.
       xcommit = x.                                             "Performance
       if not xblnr_sd is initial.
         xmkpf-xblnr    = xblnr_sd.
         xmkpf-le_vbeln = xblnr_sd.                                 "XAN-SPM
         modify xmkpf index 1.
       when a goods movement for an inbound or outbound delivery is posted
       directly from VL31N/ VL01N, XBLNR is not yet known when we call
       CKMV_AC_DOCUMENT_CREATE, but the number is supposed to be stored in
       BKPF as well. There is no other way to forward XBLNR to FI as not
       every document is posted by MB_CREATE -> a new function module in
       MBWL for transferring the information, called by FI, meant to load
       the complete function group for all MBxx postings when this isn't
       required (Performance). Would be the better way to transport the
       information after switching off MBxx in later release.
       corresponding IMPORT ... FROM MEMORY ... can be found in
       AC_DOCUMENT_POST (FORM FI_DOCUMENT_PREPARE (LFACIF5D))
         l_mem_id = 'MKPF-XBLNR'.                                   " 641365
         export xblnr = xblnr_sd to memory id l_mem_id.             " 641365
       endif.
       if xmkpf-xabln is initial.                               "note 434093
           call function 'MB_XAB_NUMBER_GET'.                   "note 434093
       endif.                                                   "note 434093
    enhancement-point mb_post_goods_movements_01 spots es_saplmbwl static.
    $$-Start: MB_POST_GOODS_MOVEMENTS_01----
    $$
    enhancement 26  dimp_general_saplmbwl.    "active version
    data: l_statics_lock type c.
    endenhancement.
    $$-End:   MB_POST_GOODS_MOVEMENTS_01----
    $$
    enhancement-point mb_post_goods_movements_02 spots es_saplmbwl.
    $$-Start: MB_POST_GOODS_MOVEMENTS_02----
    $$
    enhancement 25  dimp_general_saplmbwl.    "active version
    read table xvbfa index 1.
    if sy-subrc is initial and
       g_vbtyp_v = '7'.
       perform get_mdiff_kenz(sapmm07m) changing l_statics_lock.
    endif.
    endenhancement.
    $$-End:   MB_POST_GOODS_MOVEMENTS_02----
    $$
       call function 'MB_CREATE_MATERIAL_DOCUMENT_UT'
            exceptions
              error_message = 4.
    As soon as we have started to put things into UPDATE TASK, we must
    ensure that errors definitely terminate the transaction.
    MESSAGE A is not sufficient because it can be catched from
    external callers which COMMIT WORK afterwards, resulting in
    incomplete updates. Read note 385830 for the full story.
       if not sy-subrc is initial.
      message id sy-msgid type x number sy-msgno with            "385830
                     sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        MESSAGE A263.
       endif.
    Optische Archivierung
    Spaete Erfassung mit Barcode
    Redesign of barcode handling -> note 780365
      perform barcode_update(sapmm07m) using xmkpf-mblnr
                                             xmkpf-mjahr
                                             barcode.
      move-corresponding xmkpf to emkpf.
      call function 'MB_MOVEMENTS_REFRESH'
        exceptions
          error_message = 4.
       move-corresponding xmkpf to emkpf.
       call function 'MB_MOVEMENTS_REFRESH'
            exceptions
              error_message = 4.
       if not sy-subrc is initial.
         message id sy-msgid type x number sy-msgno with             "385830
                    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       MESSAGE A261.
       endif.
       perform buchen_initialisieren(sapmm07m).
       clear emkpf-subrc.
    clear global fields when COMMIT WORK                     "Performance
       if not sy-oncom = p.
         perform clear_xcommit on commit.
       else.
         perform clear_xcommit.              "if this FB is called on commit
       endif.
       perform clear_xcommit on rollback.                       "note 303392
    endfunction

    hi
    check SAP  Note 556000 - Short dump due to note 385830
    Summary
    Symptom
       Consider the subsequent note 561872 !                             *
    You want to post a goods receipt for a reference document (for example purchase order, delivery ...). The checks do not cause any error. Nevertheless, the system generates a short dump which is deliberately triggered by note 385830.
    One known scenario is a stock transfer process via a delivery: You have entered a stock transport order assigned to a sales order and post a goods receipt for the delivery via transaction MIGO. The sales order must be in valuated. The material to which postings are to be made is valuated separately and to be handled in batches. And the batch, which was assigned via the delivery, already exists with a valuation type in the receiving plant which is different from the one specified in the purchase order.
    Other terms
    MB_CREATE_GOODS_MOVEMENT, MIGO, MCHA, BWTAR.
    Reason and Prerequisites
    Prerequisites: see above. This is a program error.
    Solution
    Implement the attached program corrections.
    Then implement the subsequent note 561872.
    After the implementation of the note, checks are carried out in the program flow - if a batch and a valuation type were entered for a goods movement (for instance with reference to the purchase order or delivery) - on whether the assignment of the batch and valuation type is correct.
    regards
    KI

  • Logical databse in repeat

    Hi
    I call in loop logical database by FM LDB_PROCESS in different parameters but only first step is return ok
    next return error subrc = 1 LDB_NOT_REENTRANT
    How to init this calling in second step?

    Hi
    Firstly why you are calling the LDB using FM instead mentioned that in Program attributes and call that using GET statement ?
    Regards,
    Sreeram

  • Problem in creation of HUs through FM HU_REPACK and HU_POST

    Hi Experts
    This is regarding the problem in creation of HUs with function modules HU_REPACK and HU_POST.
    I am sending two Unique Sources HUs with single destination HU for the same material and batch into HU_REPACK and it shows that it is successfully repacked and soon as the HU_REPACK function module passess I have called HU_POST without any parameters except messages..As the data will be picked up auomatically from the internal memory as these function module are related same function group.
    Even the HU_POST FM passes successfully and also it creates a Transfer order but the problem is that THe HU is created with the MULTIPLE LINE ITEMS for the same material and Batch which should not be done at all .
    Please find the example of the HU created in the system
    0 10020000038479 S-DISP 1 EA S DISPNSARY
    1 0024632192 000004 810062 0.250 KG L0533A4172 Lactose
    1 0024632192 000004 810062 24.900 KG L0533A4172 Lactose
    Material is 810062
    Batch is L0533A4172
    Can you please assist me how to acheive single line item HU when we are trying to repack the data for same material and batch as it does while you create the HU through Manual processing i.e HU02 etc

    Hi Sailaja,
    I have similar requirements like this before with HU_PACKING_AND_UNPACKING FM. It was a tough debugging before I came up with the right solution. Unfortunately, I was not able to document that code..
    But here is what I have been doing.
    Youre on track with the solution below, never use BDC as it will only limit the Handling units that you wish to put into.
    The function modules that starts with V5_ plays important role as you need to initialize the global variables and table of this function group with values before calling HU_PACKING_AND_UNPACKING FM
    Debug inside the Function module, and look for the FM that returns SY-SUBRC <> 0 then set a breakpoint.
    Restart the program then debug inside that FM again (and I do not want to go further on the details, I give you the presumption of literacy)
    You will find some items that has no value, try to initialize everything by utilizing the FM for this function group V51S.
    Happy Debugging.

  • Creation of Sales Order from Service Order

    Hi All,
    I am usind BADI Workorder_update and method at_save to create a Sales Order while saving the Service Order.
    I have created the ZBAPISALESORDER_CREATEFROMDAT2 which is a copy of BAPI_SALESORDER_CREATEFROMDAT2(Since order type was ZDR).
    I have written the following stmt for Debt Memo.
                BUSINESS_OBJECT         = 'BUS2096'              " Debit Memo
    This BAPI is working fine and giving the Sales Order Number as a pop-up for information.
    But now, the problem is coming with Service Order Creation (In the transaction IW31). It is giving short dump while saving the service order after creating the sales order.
    I have checked in the standard code of Service Order. Dump is coming at
    Include : LCOZFU64
    Function Module:CO_ZF_PROJECT_BUDGET_CHECK
    Line : 258
    IF caufvdg-netzkont IS INITIAL.
              CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                  objnr             = caufvdg-objnr
                  status            = stk_vkt
                EXCEPTIONS
                  object_not_found  = 01
                  status_not_active = 02.
              subrc = sy-subrc.
            ELSE.
            ...ansonsten kann man das an NETZKONT erkennen!
              IF caufvdg-netzkont EQ con_kont_kopf.
                subrc = 02.                "kopfkontiert
              ELSE.
                subrc = 00.                "vorgangskontiert
              ENDIF.
            ENDIF.
    With my code of BAPI, it is returning sy-subrc = 01 (Object not found).
    Without my code of BAPI (Standard code of IW31), it is returning sy-subrc = 02 (status not active) which is the right one.
    Kindly help me in this regard.
    Regards,
    Priyanka Vasudeva.

    Hi,
    There are various scenarios to support end to end work managmenet process in IS-U find attached detail document at link below.
    [http://help.sap.com/saphelp_utilities472/helpdata/en/6a/1a6c35a018d041e10000009b38f839/frameset.htm]
    Scenario A describes process of creating sales order based on service order.

  • Question on Search Help and Authorization Check for Sales Order Type

    Question 1:
    When I go to VA01 and click the search help, it shows only order type that are not blocked.
    However, when I have sales order type in select-options of a Z program,
    S_AUART FOR VBAK-AUART
    I click on the search help, it gives all the sales order types. How can I have a list with unblocked sales order type only?
    Question 2:
    I want to check whether a use can extract data from a sales order type (e.g. OR and RE)that he/she authorized to use.
    I have include the following in my program:
    AUTHORITY-CHECK OBJECT 'AUART'
    ID 'AUART' FIELD 'OR'.
    It always returns SY-SUBRC = 12.
    But order type 'OR' is granted to the user (he/she can create order with type OR in VA01)
    Please kindly give me some ideas, thanks.

    hi,
    ad1
    use following code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR auart.
      PERFORM auartGet.
    FORM auartGet.
        CALL FUNCTION 'RV_HELP'
             EXPORTING
                  KEY            = VKORG
                  KEY2           = VTWEG
                  KEY3           = SPART
                  KEY4           = '0'
                  NUMBER         = '008'
                  FIELD_IN       = AUART
             IMPORTING
                  FIELD          = AUART.
    ENDFORM.
    ad2.
    example:
       AUTHORITY-CHECK OBJECT 'V_VBAK_AAT'
             ID 'AUART' FIELD 'OR'
             ID 'ACTVT' FIELD '01'. "01-create order, 02-change, 03 display
    check sy-subrc eq 0.
    regards,darek

  • Doubt in loop

    Hi Gurus...........
    i have my code below ...problem is that when it goes for the first time if get the
    value but when it goes again in to the loop , first loop is getting exected
    the second and the third loop returns sy-subrc 4 thou it has value.....
    iam not able to find it out y????can you plzzz helppp???
    Code of loop
    ===============
    LOOP AT it_pos INTO wa_pos .
      READ TABLE it_kna1 INTO wa_kna1 WITH KEY kunnr = wa_pos-konto .
      IF sy-subrc = 0.
         wa_final-name1 = wa_kna1-name1.
         wa_final-xblnr = wa_pos-xblnr.
        read table it_t005u into wa_t005u with key  bland = wa_kna1-regio.
        If sy-subrc = 0.
          wa_final-bezei = wa_t005u-bezei.
         Endif.
      Endif.
    Loop at it_vbrp into wa_vbrp  where vbeln = wa_bkpf-vbeln.
        read table it_vbrk into wa_vbrk with key vbeln = wa_vbrp-vbeln.
        If sy-subrc = 0.
          wa_final-knumv = wa_vbrk-knumv.
        Endif.
        wa_final-arktx = wa_vbrp-arktx.
        wa_Final-fkimg = wa_vbrp-fkimg.
        move wa_final-arktx to wa_final-a.
        move wa_final-fkimg to wa_final-b.
        qty = wa_vbrp-fkimg.
        split qty at '.' into text2 text3.
        move text2 to wa_final-b.
        concatenate wa_Final-a '-' wa_final-b into wa_final-c separated by space.
        wa_final-name1 = wa_kna1-name1.
        wa_final-xblnr = wa_pos-xblnr.
        Loop at it_konv into wa_konv where knumv = wa_vbrk-knumv and  kposn = wa_vbrp-posnr.
          wa_pos-dmshb = ( wa_konv-kwert ) - ( ( wa_konv-kwert * ra_data ) / 100 ).
          wa_final-dmbtr = wa_pos-dmshb.
        Endloop.
      Endloop.
      Append wa_final to it_final
      clear: wa_bkpf, wa_kna1, wa_t005u,wa_vbrk, wa_vbrp, wa_konv, wa_final, wa_pos.
    ENDLOOP.
    Edited by: Matt on Apr 9, 2009 1:20 PM - added  tags

    Position of your append is wrong ...
    it should be above all the endloop.
    Edited:
    LOOP AT it_pos INTO wa_pos .
      *** logic ***
      READ TABLE it_kna1 INTO wa_kna1 WITH KEY kunnr = wa_pos-konto .
      *** logic ***
      read table it_t005u into wa_t005u with key bland = wa_kna1-regio.
      *** logic ***
      Loop at it_vbrp into wa_vbrp where vbeln = wa_bkpf-vbeln.
        *** logic ***
        read table it_vbrk into wa_vbrk with key vbeln = wa_vbrp-vbeln.
        *** logic ***
        Loop at it_konv into wa_konv where knumv = wa_vbrk-knumv and kposn = wa_vbrp-posnr.
          *** logic ***
          Append wa_final to it_final "Check position of this statement.
        Endloop.
      Endloop.
    ENDLOOP.
    Regards,
    Lalit Mohan Gupta.
    Edited by: Lalit Mohan Gupta on Apr 9, 2009 4:45 PM -  Written the skeleton of code. Label Edited

  • Read table data from Adobe Form in WD method

    Hello,
       Context is like this :
       ADOBE_DATA        --- Node
             POS                  -
    Node   which has Dict. Stru : TABLE  card : o..n
                   POSNR       --- Attribute
                   MATNR       -
    Attribute
    Created Adobe Interactive Form through the template source of view layout.So xml schema generated automatically
    and is all ok.
    Method on action Submit :
    DATA :
    Node_zatodv_pos       type ref to If_Wd_Context_Node,
    it_zatodv_pos TYPE STANDARD TABLE OF zatodv_tab_pos.
    Node_pos =
                 Node_Adobe_data->get_Child_Node( Name = If_MAIN=>wdctx_POS ).
      Node_pos->get_static_attributes_table( importing table = it_zatodv_pos ).
    When I test the application,this method returns SY-SUBRC is 0 but internal table is "always empty".
    I have also individual attributes in the context which are read correctly.Only get_static_attribute_table doesn't read the table content.Please could any one help me where would be the problem.
    Thank you

    Hi peter,
    If you are trying to add data to a standard SAP table then you should use a FM or BAPI for that but if the table is not standard then you can use following steps but it would be better to do it using FM or BAPI.
    Do the following(without FM/BAPI):
    1. Crate a context in your view mapped to the fields of the database table.
    2. Now use this context as the data source for the form.
    3. Map the fields of the form with the attributes of the context.
    4. Now create a button on the form or on your view which has a action event handler method.
    5. In the method use code wizard to read the context attached to adobe form. By default it will create a structure containing data, which will be sufficient for adding one record at a time.
    6. Now use this structure to add data to table using SQL queries.
    Do the following for FM/BAPI integration:
    1. Create a FM/BAPI which has the functionality to add data to your SAP table.
    2. Now use service call to add the FM/BAPI fields as a context to your web dynpro component's context.
    3. Now map it with the view where the adobe form is created.
    4. Follow steps 2nd, 3rd and 4th as above.
    5. Now in your Action method use code wizard to call the method created by service call to FM/BAPI.
    This will work as required.
    Please reward points if useful.
    Regards,
    Vaibhav Tiwari.

Maybe you are looking for