MRP RUN for the more than one line item in sales order.

Hi ,
In the sales order nuber of line item are , i will have to take MRP RUN for selected line item .
So plz suggest what development will require?
Abhay
Edited by: abhay patil on May 30, 2008 8:52 AM

HI,
U can write separate prog. Which will ask sales order no. and from to line item or multiple line item of sale order. Then in loop internally pass the each line item no to MD50 prog. Which will run in background.
I will give u sample prog. Which I had created for running MRP for all the lines items of given sales order in one go.
*& Report  ZPRG_PP_001
REPORT  ZPRG_PP_001.
tables vbak.
data: begin of it_vbap occurs 1,
        vbeln  type    vbap-vbeln,
        posnr  type    vbap-posnr,
      end   of it_vbap.
DATA: P_MODE   TYPE    C.
      Batchinputdata of single transaction
DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
selection-screen begin of block b1 with frame title text-001.
  parameters :   p_vbeln  like  vbak-vbeln obligatory.
  selection-screen skip.
  parameters :   p_fore   radiobutton group mode,
                 p_back   radiobutton group mode default 'X'.
selection-screen end   of block b1.
at selection-screen.
Check Sales Order
  if not p_vbeln is initial.
    select single * from vbak
      where vbeln eq p_vbeln.
    if sy-subrc <> 0.
      message e499(sy) with 'Invalid Sales Order no.' p_vbeln.
    endif.
  endif.
start-of-selecTION.
Get Sales order items
  select vbeln posnr from vbap
    into table it_vbap
    where vbeln eq p_vbeln.
Set BDC mode
  if p_back eq 'X'.
    p_mode = 'E'.
  else.
    p_mode = 'A'.
  endif.
Process MD50 BDC
  LOOP AT IT_VBAP.
    perform bdc_dynpro      using 'SAPMM61X' '0160'.
    perform bdc_field       using 'BDC_CURSOR'  'RM61X-TRMPL'.
    perform bdc_field       using 'BDC_OKCODE'  '/00'.
    perform bdc_field       using 'RM61X-KDAUF'  IT_VBAP-VBELN.
    perform bdc_field       using 'RM61X-KDPOS'  IT_VBAP-POSNR.
    perform bdc_field       using 'RM61X-BANER'  '1'.
    perform bdc_field       using 'RM61X-LIFKZ'  '3'.
    perform bdc_field       using 'RM61X-PLMOD'  '3'.
    perform bdc_field       using 'RM61X-TRMPL'  '1'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_OKCODE'   '=XBAC'.
    CALL TRANSACTION 'MD50' USING BDCDATA MODE P_MODE.
    CLEAR BDCDATA.
    REFRESH BDCDATA.
  ENDLOOP.
end-of-selection.
       Start new screen                                              *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM  = PROGRAM.
  BDCDATA-DYNPRO   = DYNPRO.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA.
ENDFORM.
       Insert field                                                  *
FORM BDC_FIELD USING FNAM FVAL.
  CLEAR BDCDATA.
  BDCDATA-FNAM = FNAM.
  BDCDATA-FVAL = FVAL.
  APPEND BDCDATA.
ENDFORM.
Ajay P. Nikte

Similar Messages

  • GL account balance splitting in more than one line item in FSV

    Friends,
    While going through the FSV, gl account balance is splitting in more than one line item with same account name.  But if we total the line items ultimately it is tallying with GL balance.  What might be the reason.  Why it is splitting the balance in more line items with same name and same account number.

    Dear,
    You might be having Document Splitting Activation.with Bussiness Area/ Segment wise/Profit Center Wise. For this please Check - Path > Spro > SAP reference IMG > Financial Accounting (New) > General Ledger Accounting (New) > Business transactions > Document Splitting > Define Document Splitting Characteristics for General Ledger Accounting.
    Please go through this & will  be able see the Document Splitting is based on Bussiness Area/ Segment wise/Profit Center wise or may be both.
    T & R,
    Madhuri Panda

  • More than one service Performer per sales order position

    Hallo ByD community
    We are using service type "Service - time and material" in our sales orders and we are using the integrated time recording in the self-service (time sheet) to track actual times for an sales order. For that you have to assign a service performer in the sales order position, so that the person is able to enter acutal times for this sales order Now it can happen that not only one person, but a team (or two or more people) has to record times for this sales order position.
    is that possible and if not what would you suggest.
    F.e.. in project management you can activate time recording for a project task for several people.
    Thank you :-)
    BR

    Hi  lisa ,
    It is not possible to enter more than one service performer for a service in sales order .
    But you can  perform the service with two people and have two service confirmations.
    The time entered in service confirmation will be reflected in invoice only(if time and material).
    Also you cannot enter the time sheet with respect to sales order , it is only valid for project task and
    and time types.
    Regards,
    Harish

  • SPLITTING MORE THAN ONE LINE ITEM IN ECC6.0

    Hi everyone.
    I am using New GL functionality in ECC6.0. I have a big question regarding multiple objects splitting. Ej: Purchase of a service.
    If I set one cost centre in the expense line item, the profit centre and segment are determined automatically in the vendor line (in the vendor invoice).
    Then I post the payment and, without introducing any cost object, the profit centre and segment are determined automatically in both balance line items. Everything is ok.
    However if in the original vendor invoice I use 2 cost lines with different cost centres: New GL splits everything alright and I get the vendor lines splitted with the right profit centre. When I post the payment, with new GL I don't get any split or balance line are properly posted with a PC.
    Resuming, splitting works properly in both vendor invoice and manual outgoing payment when originally there is only one cost line and one cost centre. However, when using 2 cost line with different cost centres, splitting is only working in the vendor invoice but I can't get it work in the manual outgoing payment.
    Thanks for your help.
    Miguel

    There is a config setting called classify document type for document splitting, or something like that.
    Here you have all of your doc types, and then you assign a business transactions
    The point I am making is that you need to check there, and that the config for the business transactions are the same.
    Can you confirm if the payment document actually posted. If it did then it passed the config rules you have set for doc splitting. Make sure you are looking at like for like and both documents are the general ledger view and not the entry view.

  • More than 1 line items in bdc using table controls for BOM

    Hi....
    how do u update more than one line item for BOM using BDC table control.......
    is there any specific command for doing that.......
    hav tried d following code bt it takes the flatfile i/p FOR 2 LINE ITEMS as 2 different BOM'S.....
    would appreciate ur help....plz provide code.............
    REPORT zbdc4_cs01
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    INCLUDE bdcrecx1.
    DATA : a TYPE i,
           b type i,
           c type i.
    DATA : BEGIN OF it_rec OCCURS 0,
           rec(200) TYPE c,
           END OF it_rec.
    DATA : BEGIN OF ctab OCCURS 0,
           matnr(18),
           werks(4),
           stlan(1),
           END OF ctab.
    DATA : BEGIN OF xtab OCCURS 0,
           idnrk(18),
           menge(13),
           postp(1),
           END OF xtab.
    DATA : BEGIN OF itab OCCURS 0,
           matnr(18),
           werks(4),
           stlan(1),
           idnrk(18),
           menge(13),
           postp(1),
           END OF itab.
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = 'C:/TEST4.TXT'
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = it_rec.
      LOOP AT  it_rec.
        a = strlen( it_rec-rec ).
        if a = 55.
        itab-matnr = it_rec-rec+0(18).
        itab-werks = it_rec-rec+18(4).
        itab-stlan = it_rec-rec+22(1).
        itab-idnrk = it_rec-rec+23(18).
        itab-menge = it_rec-rec+41(13).
        itab-postp = it_rec-rec+54(1).
        APPEND itab.
        elseif a > 55.
        itab-matnr = it_rec-rec+0(18).
        itab-werks = it_rec-rec+18(4).
        itab-stlan = it_rec-rec+22(1).
        itab-idnrk = it_rec-rec+23(18).
        itab-menge = it_rec-rec+41(13).
        itab-postp = it_rec-rec+54(1).
        APPEND itab.
        itab-idnrk = it_rec-rec+55(18).
        itab-menge = it_rec-rec+73(13).
        itab-postp = it_rec-rec+86(1).
        APPEND itab.
        endif.
      ENDLOOP.
      PERFORM open_group.
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29N-STLAN'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29N-MATNR'
                                       itab-matnr.           "'3000000107'.
        PERFORM bdc_field       USING 'RC29N-WERKS'
                                       itab-werks.              "'UN02'.
        PERFORM bdc_field       USING 'RC29N-STLAN'
                                       itab-stlan.              "'1'.
        PERFORM bdc_field       USING 'RC29N-STLAL'
        PERFORM bdc_field       USING 'RC29N-DATUV'
                                      '11.08.2008'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0110'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29K-BMENG'
                                      '1'.
        PERFORM bdc_field       USING 'RC29K-STLST'
                                      '1'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29K-EXSTL'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0111'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29K-LABOR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSTP(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RC29P-IDNRK(01)'
                                       itab-idnrk.             "'1000000232'.
        PERFORM bdc_field       USING 'RC29P-MENGE(01)'
                                       itab-menge.              "'100'.
        PERFORM bdc_field       USING 'RC29P-POSTP(01)'
                                       itab-postp.             "'L'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0130'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR'.
        PERFORM bdc_field       USING 'RC29P-POSNR'
                                      '0010'.
        PERFORM bdc_field       USING 'RC29P-IDNRK'
                                      '1000000232'.
        PERFORM bdc_field       USING 'RC29P-MENGE'
                                      '100'.
        PERFORM bdc_field       USING 'RC29P-MEINS'
                                      'KG'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0131'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POTX1'.
        PERFORM bdc_field       USING 'RC29P-SANKA'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RC29P-POSNR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=FCBU'.
        PERFORM bdc_transaction USING 'CS01'.
      ENDLOOP.
      PERFORM close_group.

    Hi
    Check this sample code for the Table Control in BDC:
    data: fnam(20) type c.
    move 1 to id.
        loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
          concatenate 'RM06E-EPSTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-itmcategory.
          concatenate 'EKPO-KNTTP(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-accassignment.
          concatenate 'EKPO-EMATN(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-material.
          concatenate 'EKPO-TXZ01(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-shortxt.
          quan = ti_staging-poqty.
          concatenate 'EKPO-MENGE(0' id ')' into fnam.
          perform bdc_field       using fnam quan.
          concatenate 'RM06E-EEIND(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-deliverydate.
          netpr = ti_staging-netpr.
          concatenate 'EKPO-NETPR(0' id ')' into fnam.
          perform bdc_field       using fnam netpr.
          concatenate 'EKPO-MATKL(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-mategroup.
          concatenate 'EKPO-WERKS(0' id ')' into fnam.
          perform bdc_field       using fnam TI_STAGING-plant.
          ID = ID + 1.
        ENDLOOP.
    Regards,
    Vishwa.

  • To add the object link at a time more than 13 line items

    Dear All,
    Can you help me regarding the below statment.
    In object link in cv01n and cv02n t-code have limitation to add the object at a time 13 line items. If you add the more than 13 line items it takes  time. If there is any provision to add the more than 13 line items at a time.
    Thanks
    Asutosh

    Hi,
    In transaction CV02N unfortunately this is not possible to enlarge the line number. To add a lot of objects to a document info record you may use DMS BAPI_DOCUMENT_CHANGE2. You can use BAPI_DOCUMENT_GETDETAIL2 to read out the current document data and then hand over to BAPI_DOCUMENT_CHANGE2, where you can add new objects in table 'OBJECTLINKS'.
    Best regards,
    Christoph

  • A header data can have more than one lie item data !

    How can a header data have more than one line item data ?

    Hi,
    header table will have only main data where as the item data will have material delivery date other things based on the availabilty and committement
    http://help.sap.com/saphelp_srm30/helpdata/en/38/4cc5376848616ae10000009b38f889/content.htm
    Regards
    Shiva

  • Add Line Item In Sales Order VA01

    HI All,
    I  have new requirement in creation of sales order . Here we have free promotion sales . Here if customer buy one material then he will get some other material as free .In standard sap we can give only one line item as free not more than that .
    Here our requirement is more than one line item . I suggested them maintain all the free materials in one Ztable when ever the original material  will come for  sales order then i have to fetch these materials from ztable  automatically and it should create sales order. I started doing this using user exit  FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    These are the below links i checked in our sdn.
    Adding Line items to sales order on creation using User-Exit in VA01.
    Please give me some idea on this .
    Regards,
    Madhu.

    Hi Asik,
    Thanks for your reply.In my case i can not got for Bom  because the schemes will change for every ten days. I think Bom  creation will fill a lot of data but it wont solve my issue.
    Regards,
    Madhu.

  • Display more than one line of text for events?

    I couldn't find this in the forum... I just recently updated to Leopard. Now when I put events in iCal, it only displays one line of text in the month calendar view. I'd really like to see the whole description of the event, even if it's two or three lines. I can't find anything in preferences that addresses this, and various searches are not yielding anything. Help?
    -mel

    Hi there.
    Usually in iCal if you want more than one line of text for timed events, resizing the window will help. Under all-day events, iCal will always show you one line of text, but if there is more space it will show you more text. So, also resizing the window for this will help to see the text.
    Take care.

  • INDESIGN GLITCH: Creating an XML file from Indesign Layout - Issue "Using more than one line of GREP" & "Map Styles to Tags"

    I currently create XML from InDesign CC by Mapping Style to Tags.
    - The Paragraph Styles are manually apply to text. These styles include multiple lines of GREP to automatically apply character styles.
    - I map some of the paragraph and character styles to prebuilt tags that have the same name "Map Styles to Tags".
    I have found through trouble-shooting that InDesign is unable to "Map Styles to Tags" for more than one line of GREP. I therefore have to chose which line of GREP to automatically tag and which lines to manually tag.
    Please can anyone help, I need to automatically map tags to at least two character styles in one paragraph via GREP.
    Thanks,

    OK. The best I can suggest is running a Find/Change like this:
    Which will actually apply the character style to the italics (and I would do the bold as well just to make certain). Then run the Map Styles to Tags again, using the Apply by Name. Which will tag the italics.
    I don't know why ID can map to the bold and not the italic character style. It either should do them both (as in this instance) or none at all as the character styles are not actually applied by the grep, just the styling from the character styles.
    Mike

  • Problem in CRM_ORDER_MAINTAIN for updating qty in more than 1 line item .

    Hi abapers,
    I am using BAPI CRM_ORDER_MAINTAIN to update quantity. Its updating the quantity properly if there is single line item for a transaction .If more than 1 line item is there then its throwing an exception* "Document is being distributed - changes are not possible"*.
    Scenario:
    I have a itab  which is having 2 line items for a transaction. i run a loop pass the pass the required parameters in CRM_ORDER_MAINTAIN ,do CRM_ORDER_SAVE , BAPI_TRANSACTION_COMMIT for the 1st line item. When i run the 2nd loop, in  CRM_ORDER_MAINTAIN it gives an exception saying NO_CHANGE_ALLOWED for the same transactions 2nd line item. leaving the quantity unchanged for both the line items. What may be the problem?
    Note: We cannot say how many line items are there for an transaction. so no chance of grouping all items at a time and saving at a time.
    Regards,
    Navin

    Hi Navin,
    Why its not possible to use CRM_ORDER_SAVE only once. I think its possible. Call CRM_ORDER_MAINTAIN in loop for all the line item in transaction and after that call CRM_ORDER_SAVE once. Pls follow the below sample code.
    loop at it_item.
    call CRM_ORDER_MAINTAIN. (Here append data for all the line items and miantin the transaction).
    emdloop.
    After endloop call CRM_ORDER_SAVE. Also you can add some wait after CRM_ORDER_SAVE, In order to avoid locking issue.
    PLs let me know where you are trying to use CRM_ORDER_MAINATIAN ? In any BADI or Z program ?
    Regards,
    Amol.

  • More than 999 line items for an FI Document

    Hello All,
    Per SAP standard, an accounting document can only contain up to 999 line items. However, we have Logistics posting (Backflush) that would yield more than 999 line items in FI. We can't opt for setting summarization in transaction OBCY (FI Summarization based on Object Type) since this would affect GR/IR clearing. We can select reference transaction key MKPF (Material Doc Table) and table BSEG (Field MENGE <Qty>) but GR/IR clearing would be affected since definition of clearing is at Purchasing Doc (EBELN) and Item (EBELP).
    Do you have other recommendations?
    Thanks.

    Dear scorpio0485,
    Yes ! I have already done posting for morethan 999 line items. but in the standard program we cant do it. We need to go for Z process.
    In Zprocess we need to put one cut off line item for ex : 900 or 950. After that hardcode one GL code(clearing GL Code) in program to split the line items. Means the system generates 2 documents.
    Please give the following Code to ABAPer
    AT END OF xblnr.
          mtab[] = ttab[].
          CLEAR v_count1.
          DESCRIBE TABLE ttab LINES v_lines.
          LOOP AT ttab INTO wa_ttab.
            v_tabix = sy-tabix.
            v_count = v_count + 1.
            IF v_count EQ 900.
              count = count + 1.
              v_count1 = v_count + v_count1.
              MOVE-CORRESPONDING wa_ttab TO wa_xtab.
              IF v_wtotal < 0.
                wa_xtab-newbs = '40'.
                wa_xtab-newko = '00003100001'.
              ELSE.
                wa_xtab-newbs = '50'.
                wa_xtab-newko = '00003100001'.
              ENDIF.
              IF v_dtotal < 0.
                wa_xtab-newbs = '40'.
                wa_xtab-newko = '0003100001'.
              ELSE.
                wa_xtab-newbs = '50'.
                wa_xtab-newko = '0003100001'.
              ENDIF.
              IF v_dtotal LE 0.
                v_dtotal = v_dtotal * -1.
              ENDIF.
              IF v_wtotal LE 0.
                v_wtotal = v_wtotal * -1.
              ENDIF.
              wa_xtab-prctr = '0000900008'.
              wa_xtab-dmbtr = v_dtotal .
              wa_xtab-wrbtr = v_wtotal .
    If you need anymore,please let us know

  • Mayday, maday !!! could someone teach me how to run my passport more than one day

    I just got my passport yesterday ,could someone teach me how to run my passport more than one day.
    please see the picture, I just received some calls and surf the internet less than 1h today.
              thank you a lot.

    press both volume keys down for 30 seconds and see if it persists after
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • How to pack the More than one sales order delivery qty in one packing

    Hi Folks,
    How to pack the more than one sales order quantity combinely during packing?
    Thansk in advance and points wil be rewarded for the reply.
    Best Regards
    Srinivas

    Packing is done during Delivery.
    In Sales order also Packing function is available but as a Packing proposal.
    So actual packing is done in Delivery.
    When you process several sales orders together, the sales order items having same Ship-to-party, Shipping point, Route, Delivery due date & Incoterm are combined into one Delivery in the standard system.
    In the delivery overview screen,do the picking by subsequent function rom the menu bar, you will get a button "PACK", click on this system will take you to the packing screen.
    In the packing screen, give the packaging mterial number, select the materials to be packed, select the packaging material also and the click on the "PACK" button.

  • More than one line beside a category icon

    Hello,
    I have in a page placed the text item category icon, and space a then the display name of the item. The problem is that as the text of the display name is too long when it makes an automatic return makes it under the category icon. It seems to be a problem with the number of text lines that can be placed beside the category icon.
    How can I make that the category icon accepts more than one line of text beside it?
    Thanks in advance,
    Izzat Sabbagh
    ITC

    I'm sure you can use html, like
    String tooltip = "<html>first line<br>second line</html>";Perhaps it works without html if you use newline '\n'.

Maybe you are looking for

  • Problem while changing decimal places in SAP B1 2007

    Hi Experts, I want change the decimal places of Quantity type fields from 2 decimal places to 4 decimal places. But while changing it in Genral settings form ,it shows the error message "Cannot update while another user is connected to the company".

  • Embedding xml into a pdf

    I have a LiveCycle form that fills its dropdownlists from an xml file. It will be on a server, where the client can click a button on a webpage to download the pdf. The data in the xml file will change every now and then. Is it possible to refresh/re

  • Account determination in SAP?

    hii experts, Account determination is major concern in SAP. Whether account determination will be done only SAP MM consultant or any other module responsibilities in account determination? Becas SAP has more business scenario , each will have account

  • Sharing Automator Actions?

    I created a simple automator action. For those with VirusBarrier Plus, you'll note that it cannot watch folders, just scan them or do schedule scans. This means it can't scan everything you download. Until... I made a simple automator action. When a

  • "Hold Payment" in IT0009

    Gentlemen, I wish to add "Hold Payment" option in Indian Payroll (We are using ECC 6.0) info-type 0009 (bank details). There is no such option in standard customizing (IMG in Payroll India). Can you help me how I can do it? Thanks in Advance. Regards