Inserting PO and Item fileds in settlement rule in IW31/32/33

Hi ,
My requirement is as follows:
I want to store a PO and PO Item to a CS Order (IW31/32/33) in Settlement rule screen  exclusively.
I came to know that it is not possible to associate a purchase Order through configuration.
Plz suggest the possible Enhancement / exits/BADIs or any other methd for inserting a PO and Item field in settlement rule in transaction IW32.

Hi,
I am unable to attach the Screen Shot for your refrence, Here SCN is not supporting me .
So i have send you the Code:
I created ztable name ZPM_TABLE
with fields ZEBELN
                  ZEQUNR
                  ZTPLNR
In which PO No Equipment No and Functional Location Data is stored..
Then in Exit IWOC0003..
I written Code to fetch the Po Vendor Details  for that particular Equipment No or Functional Location Value as follows :
Please Note :
In My Code I have used Submit Program Name to get the Po Item Values :
Code as Follows:
{ if sy-tcode eq 'IW21' or
   sy-tcode eq  'IW31'.
tables : ekko,
         lfa1,
         adrc,
         t005u,
         t005t,
         zpm_table.
data : wa_lfa1 like lfa1 occurs 0 with header line,
       it_lfa1 like lfa1 occurs 0 with header line,
       wa_popup like zpm_table occurs 0 with header line,
       it_ekko like ekko occurs 0 with header line,
       wa_adrc like adrc occurs 0 with header line,
       po_serv type zpo_service1 with header line.
      it_ser  type zpo_service1 with header line.
*data : text_val type string.
data : begin of it_popup occurs 0,
       po_no like ekko-ebeln,
       po_no1 like ekko-ebeln,
       lifnr like lfa1-lifnr,
       name1 like lfa1-name1,
       mobile like lfa1-telf2,
       street1 like adrc-str_suppl1,
       street2 like adrc-str_suppl2,
       street like adrc-street,
       pin    like  adrc-post_code1,
       tel    like adrc-tel_number,
       fax    like adrc-fax_number,
       ext    like adrc-tel_extens,
       country like  t005t-landx,
       po_text(100) type c,
       end of it_popup.
data : begin of it_ser occurs 0,
      extrow type string,
      SRVPOS type string,
      KTEXT1 type string,
       menge  type esll-menge ,
       meins  type esll-meins,
       netwr  type esll-netwr,
       end of it_ser.
data : scrn_popup like it_popup occurs 0 with header line.
data: po type string,
       text_val type string,
      ven_add type string,
      ven_no type string,
      ven_name type string,
       antwort(1) type c,
       answer(1) type c,
       choise type sy-tabix,
      text1 type  string.
data: l_answer like sy-input.
if i_equnr  is not initial.                           "here I_equnr is the Equipment No which flows in the Screen .
  select * from zpm_table into
           corresponding fields of table wa_popup
           where zequnr = i_equnr.
elseif  i_equnr is not initial and i_tplnr  is not initial. "here I_tplnr is the FL No which flows in the Screen .
  clear : wa_popup.
  select * from zpm_table into
           corresponding fields of table wa_popup
           where zequnr = i_equnr and
                 ztplnr = i_tplnr.
elseif i_tplnr is not initial.
  clear : wa_popup.
  select * from zpm_table into
           corresponding fields of table wa_popup
           where ztplnr = i_tplnr.
endif.
if wa_popup[] is not initial.
  read table wa_popup.
  select ebeln lifnr from ekko
    into corresponding fields of table it_ekko
    where ebeln = wa_popup-zebeln.
  if it_ekko[] is not initial.
    select * from lfa1 into
      corresponding fields of table wa_lfa1
      for all entries in it_ekko
      where lifnr = it_ekko-lifnr.
  endif.
*endloop.
  loop at wa_lfa1 . "into it_lfa1 WITH TABLE KEY lifnr = it_ekko-lifnr.
    select * from adrc into
      corresponding fields of table wa_adrc
      where addrnumber = wa_lfa1-adrnr.
    data:wa_t005u type t005u occurs 0 with header line.
    select * from t005u into
          corresponding fields of table wa_t005u
                  where spras = 'EN'
                  and land1 = wa_adrc-country
                  and bland = wa_adrc-region.
    data:wa_t005t type t005t occurs 0 with header line.
    select * from t005t into
       corresponding fields of table wa_t005t
                where spras = 'EN'
                and land1 = wa_adrc-country.
    it_popup-po_no = wa_popup-zebeln.
    it_popup-lifnr  = wa_lfa1-lifnr.
    it_popup-name1  = wa_lfa1-name1.
    it_popup-mobile  = wa_lfa1-telf2.
    read table wa_adrc index 1.
    it_popup-street1 = wa_adrc-str_suppl1.
    it_popup-street2 = wa_adrc-str_suppl2.
    it_popup-street  = wa_adrc-street.
    it_popup-pin     =  wa_adrc-post_code1.
    it_popup-tel     = wa_adrc-tel_number.
    it_popup-fax     = wa_adrc-fax_number.
    it_popup-ext     = wa_adrc-tel_extens.
    it_popup-country = wa_t005t-landx.
    append it_popup.
  endloop.
  text1 =  'This Equip/Func.Location is Maintained or Service is undertaken by'.
  concatenate  'Vendor No      :  ' it_popup-lifnr
               into ven_no  .
  concatenate  'Vendor Name   :   ' it_popup-name1
               into ven_name  .
  concatenate it_popup-street1
              it_popup-street2
              it_popup-street
              it_popup-pin
              it_popup-country
             'Mob:' it_popup-mobile
             'Tel:' it_popup-tel '-' it_popup-ext
                  into ven_add  separated by space.
  concatenate  'Please Refer this PO No. :   ' it_popup-po_no
               into po  .
message 'Warning!!!' type 'I'.
  Function Module for Pop Up *
  call function 'POPUP_TO_CONFIRM_WITH_MESSAGE'
  exporting
DEFAULTOPTION = 'Y'
   diagnosetext1 = text1
   diagnosetext2 = ven_no
   diagnosetext3 = ven_name
   textline1 = ven_add
   textline2 = po
   titel = 'Warning!!!'
START_COLUMN = 25
START_ROW = 6
    cancel_display = 'X'
   importing
    answer =  antwort.
  " Area for option Yes or No "" .  
  if antwort = 'J'.
    if it_popup-po_no is not initial.                      " Please Note here im checking for PO No
      export it_popup-po_no to memory id 'Memo1'.  "Po No is exported to another Program there i coded for Po items
      submit zpm_po_services and return.
    endif.
  else.
*call TRANSACTION 'iw21'.
    call transaction 'IW21' and skip first screen.
  endif.
endif. " End of  Total itab value/
else.
exit.
endif.     }
This is the Code for zpm_po_services
For any Clarification Revert Back..
With Regards,
Vinu.R

Similar Messages

  • Check on Settlement Rule in IW31

    Hi,
    I have to keep check on Settlement Rule in IW31. i have to compare the first four characters of Settlement rule with that of Planning Plant. If both are not equal an error message should be raised.
    For example Settlement Rule--->1600009  and if plant = 1500 an error message should be raised.
    Please suggest any suitable BADI or User Exit for this. I have tried many options like CL_EXITHANDLER  for BADIs. But the tables in them are not giving both Plant and Cost Center(Settlement Rule) values.
    Please help.
    Thanks
    K Srinivas

    Have a look at  exit IWO10009
    * get settlement rules from ABAP memory
      call function 'K_SETTLEMENT_RULE_GET'
        exporting
          objnr     = p_caufvd_imp-objnr
          x_all     = ' '
        tables
          e_cobra   = lt_cobra
          e_cobrb   = lt_cobrb
        exceptions
          not_found = 1
          others    = 2.
      if not sy-subrc = 0.
    * if not found, then go to database for settlement rules
        call function 'K_SRULE_READ_ARCHIVE'
          exporting
            i_archive_handle1 = 0
            i_objnr          = p_caufvd_imp-objnr
            i_append         = ' '
          tables
            t_cobra          = lt_cobra
            t_cobrb          = lt_cobrb
          exceptions
            not_enough_info  = 1
            others           = 2.
      endif.
    Make the validations you need.
    Hope it helps, saludos!

  • Maintain Settlement Rule

    Hi All
    I would like to maintain more than ten line items in maintain settlement rule screen for distribution. Currently system allows me to enter only ten distribution line items. Pleease let know to increase the way. Thanks in advance.

    hi
    in OKO7 for your settlement profile make the entries in the Max.no of dis rls and check
    regards
    thyagarajan

  • Create settlement rule for Maintenance plan

    We have a requirement to create a maintenance plan and assign a settlement rule to the same. I was able to create the maintenance plan using MPLAN_CREATE. I created the settlement rule using the function module K_SRULE_SAVE_UTASK. My problem is when I go to IP03 to check if the settlement rule has been created for the maintenance item, it is not found. When I go to IP02 and click on create and go into the settlement rule maintenance screen, I'm able to see the settlement rule created using the function module.but in the MPOS table, I don't see the indicator IND_ABRVO ( settlement rule indicator ) being maintained.
    Can you please help in finding out what I'm missing.
    Edited by: Sujay Venkateswaran Krishnakumar on Dec 31, 2009 11:34 AM

    Sri Vas,
       Is this specific to a particular WBS element or does it happen for ANY WBS element? The WBS element may not have been setup properly.Check the same WBS element directly by going to the WBS element change transaction.Also check the account assignment and status of the WBS element that Ramesh had suggested. If the WBS element has been defined properly,Try changing the settlement rule to a cost center  and see if you still get this error.
    Regards
    Narasimhan

  • Creation of settlement rules for WBS element

    Hi,
    Iam having problem when creating the settlement rules for WBS elements. The business goes like this.
    We have XI interface which creates the Idocs and an inbound program(customized) to process the Idocs. When the Inbound program is run the WBS elements are created and settlement rules are created for the WBS elements. The inbound program is run automatically thru batch job.
    First time when the Idocs are processed about 95% of the WBS elements have settlement rules created and for other 5% settlement rules are not created. The Idoc is in status 64. I tried reprocessing the Idoc and then the settlement rules are getting created succussfully. The problem is Iam not able to find why the Inbound program is not processing succusfully when its run first time but works when reprocessed.
    I appreciate if anyone can send their views.
    Best Regards
    SK

    Hi!
    You might set the processing to check not only once the relevant IDocs, but more times...
    Check out these programs, and set them into a batch job periodically...
    RBDMANI2
    RBDAPP01
    Regards
    Tamá

  • Require settlement rule when creating a Prod order

    Hello,
    Hello,
    one of our processes is to fabricate complex tools that will be capitalized and depreciated when completed.
    while the tools is being fabricated, we would like to settle regularly the production order to a capital order (AUC) and track the budget for the fabrication.
    in this production process we want to require the user to enter a capital internal order in the settlement rule of the production order master data..  this way when Prod order is settled we dont have issues.  can you make settlement rule entry as required during production order creation?
    any input is appreaciated on the issue. Thanks
    Andy

    Hi,
    There is no standart control for this, but I know a PP user exit which excatly meet you requirement.
    PPCO0007---User Exit for Checking or Changing Header Fields During Order
    You can first control if it is a production order ( ı think it is a special type to produce auc) that you want to control. Then you can select settlement rule and control and give error message settlement rule is mandotory you can not save. The exit sends a signal that it is not possible to save. For error message you can write code into the exit for the message.

  • How to create folder and items in content area without edit folder option

    Hello!!
    I would like to create something to users can create and insert folders and items in content area without using the edit folder option.They would have a form to include the name of the file and the name.i would like to do this for the end users can insert files more easily. Can i do this? Anyone can help me ??
    Thanks in advance!!!
    null

    The wwsbr_api and wwsbr_search_api packages are included in the current PDK, but won't be supported until 3.0.8 is release, later this month.
    Regards,
    Jerry
    null

  • Automatic Settlement rules generation

    PS Experts
    I need to have automatic settlement rule generation for WBS elements.
    I do have all the config (PS & IM) in place and when i release my WBS element then AUC is automatically created and no settlement rules are generated at this point.
    But when i create FINAL ASSET, then the settlement rules are generated automatically with final asset as the receiver. When i run my final settlement (CJ88) then the settlement rule is updated with AUC & Final asset.
    My question is do i need to have Investment profile to have automatic creation of settlement rules.
    What if i don't want to activate IM and still have automatic settlement rule generation?
    Edited by: Raj M on Apr 17, 2008 8:49 PM

    Hi,
    For automtic settlement rule generation folloowing steps need to be followed.
    1. Determine Strategy for Settlement Rule
    In this there will be settings for settlement rule where we define the recevier cost object after project settlement.
    This strategy will be assigned to project profile
    2. Generate Settlement
    CJB2 transaction need to be run for generation settlement for the WBSE.
    Hope this will help you.
    Regards,
    Rakesh Pradhan

  • Generation of WBS Settlement Rule

    Hi Folks!
    I was wondering if there is any function module that allow me to generate a WBS Settlement Rule for a specific project and for elements on level 3.
    If there is no FM for this, is there any workaround to do this.
    Thx for any advise.
    Regards,
    Gilberto Li

    Hi Gilberto,
    Hm, not a question that has a simple answer. Settlement rules are first of all defined in customizing how the should be behave and secondly lies the question how to update a CO cost object with this settlement rule.
    Let us first assume that customizing is done with a settlement profile named ZZ_PROF for instance. This is defined in customizing like path (from R/3 4.7): Trans SPRO -> Project System -> Costs -> Automatic and Periodic Allocations -> Settlement -> Settlement Profile -> Create Settlement Profile.
    My first advice would be to use the "automatic settlement derivation feature" that can be setup in customizing alike. Trans SPRO -> Project System -> Costs -> Automatic and Periodic Allocations -> Settlement -> Settlement Rule for Work Breakdown Structure Element. Read the docu for this node (right click and choose Display documentation) to understand what possibilities and limitations this functionality has. Below this node you have the possibility to define a "settlement strategy" and allocate this to a project profile. There is also an option to define a BADi whereby you you can somewhat influence the automatic generation of settlement rules. You must "obey" the rules in the "settlement strategy" but can do some filtering of SD orders influence and derive a "settlement strategy" baseed on some coding logic of your choice.
    To execute these settings on operative projects you run trans CJB1 (collective processing) or CJB2 (indicidual processing).
    All in all: This is good functionality but maybe not what you are looking for due to the built in "restrictions" in the "settlement strategy" profile.
    My second advice would be: What I did in the past was to write a batch input program that was run just before period end closing (that is before settlement - of course) that did read all relevant WBS elements without a settlement rule and derived a new settlement rule. Finally, updated the setttlement coding block with this info. Processing of the BDC is then done via trans SM35 the normal way.
    I also did a check for trans CJB2: In include LKAZBF15 there is the "magic" call to the update FM with name KSRG_GENERATE_RULE. One option could be to set a break point here and run the trans to see what parameters has to be filled. This implies that the customizing is done before, of course. I have a feeling that this is NOT the easist solution to use - to fill the parameters correctly may be difficult
    I hope this helps you in deciding what action to take.
    Sometimes a simple BDC will do the trick although it may not be a "good" solution.
    Disclaimer: There might be some other relevant FM to solve your problem as I am not aware of. If you find one for WBS elements then I would certainly be interested in any findings.
    Regards, Johan

  • Settlement rule amount exceeding budgetted amount

    Dear all,
    We have following scenario for our Client sytems.
    Level 1 WBS are used for orgnization.
    Level 2 WBS are used for planning & budgetting.
    It will have structure as A0**-GX-**.
    Level 3 WBS are used for actual postings.
    It will have structure as A0**GX**.
    Now under CJ03, when user selects level 2 WBS and then click on settlement rule, can he be allowed to input amount which is more than budgetted amount for this WBS.
    If yes,what is the setting we have to do? If no, please tell me why user can not be allowed to do this?
    Any pointers on this will be highly appreciated.
    Thanks
    Tushar Vhora

    Unable to understand your query.
    What is stopping you to maintain the amount settlement rule on Level 2 WBS? Settlement will only credit this sender WBS element and I don't think budget or availability control will come into picture and cause any problem. For amount settlement to happen, set the 'Amount Settlement' indicator in settlement profile.
    If your case is Level 3 WBS settling to Level 2 WBS and you've got limited budet on Level 2 WBS, you'll have issues while settling because of availability control (if active).
    To resolve this you've 2 options:
    1. Use settlement cost element (NOT By Cost Element) settlement and exempt this cost element from availability control using T Code OPTK
    2. Else adjust the budget on level 2 WBS suitably to allow settlement to happen.
    Regards
    Sreenivas

  • Header data and item data into same internal table

    Hi Experts,
    I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .Output file should be displayed like this format
    Header1  rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Item2  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Thanks
    Moderator message: Please do not use all upper case in the future.
    Edited by: Thomas Zloch on May 12, 2010 3:10 PM

    Hi,
    for example we have 3 internal tables 
    1> it_header  2>it_items   3>it_final (which contains all the header and item fields)
    once  it_header   it_items  are filled
    loop at it_items.
    read table it_header with key xyz = it_item-xyz.
    if sy-subrc = 0.
      here move all the header fields to it_final like below.
    it_final -xfield  = it_header-xfield.
    endif.
      here move all the item fields to it_final like below.
    it_final -yfield  = it_item-yfield.
    append it_final.
    clear it_final.
    endloop.
    now header and item fileds will be fillled in it_item

  • Changing the receiver cat in the settlement rule of Product cost collector

    Hi,
    I have created a Product cost collector using the Transaction - KKF6N. and observed that the settlement rule got created automatically with the CAT - MAT. I need help for below queries.
    1. Is it possible to change the settlement rule for the Product cost collector?
    2. If yes, Could you please let me know the procedure to do this?
    3. If no, what is the alternate as I want to change the CAT from MAT to ORD.
    Your help is very much appreciable and Thanks in advance for the help.

    Hi,
    Check in order type, Which settlement profile is  maintained. Then Goto settlement profile maintain receive type which you want to settle.
    Regards,
    Sreekanth

  • Configuration date of Settlement Rule

    Hello.
    Can you tell me is there any possibilitie to check when was the first (and others) configurations of Settlement Rule for WBS Element in transaction CJ03?
    Best regards
    Marcin Obukowicz

    If the first settlement run has been executed, the field/column 'First Used' would suggest the period/year when the settlement happened.
    Else use T Code SE16, enter COBRA execute, enter the object number (PR*) of the WBS and then look at the fields creation on/changed on.
    Regards
    Sreenivas

  • Error-M2O-Settlement rule for assembly order for item...could not be genera

    Hi,
    When I am creating Sales Order (VA01) for M2O, I am able to do the costing and copy the EK02 condition type. I have verified the the incompletion log, it indicates that document is complete.
    But while saving the sales order, the below error message is displaed:
    Settlement rule for assembly order for item 000010 could not be generated. Should the order still be saved?
                    Yes/No
    1. If No is choosen the following error message is displayed
           Error when processing Production order
          Error when processing Production order
          Message no. V1380
          Diagnosis
            A technical error has occurred. On calling up the assembly interface, exception 5 was triggered. The exceptions have the  following meanings:
    1 = External block,  2 = General error,  3 = Insufficient data for the interface,  4 = Order was not found, 5 = Update has been rejected, 6 = Final document number for Production order is not issued.  Procedure: Inform your system administrator.
    2. If Yes is choosen, it is creating Production Order without settlement rule. Able to perform GI & Gr. If I try to enter settelement rule (Settlement receiver SDI - Sales document item) in production order (CO02), the belwo error message is displayed
    "Distribution rule for Sales document item can only be created automatically Message no. KD063"
    We are using the requierement class with below details:
    Reqmts class: ZSO- for M2O
    AAC = E, Valuation = A, Settlement profile =SD1, RAKey = 000004, Assembly type = 3.
    Settlement profile contain:
    Allocation structure, PA structure, Default object type = SDI. Valid receivers: Optional -Sales Order / Prof. seg.
    If I make the Valuation field as blank in Reqmts class, there is no error while creating Sales order. And also Settelemnt rule with sales document item as receiver is successfully creating for the production order. Since the Valuation is blank in requirement class, it is Non valuated Sales order stock. All GIs & GR are non valuated
    The business requirement is it should be valuated sales order stock and the production varinaces has to be settled to Sales order. Then Sales order has to be settled to COPA.
    Need your valuable inputs to meet this requirement.
    Let me know if you need any further details.
    Thanks in advance.
    Regards,
    ADI

    Dear SAP PP Consultant ,
    What is the strategy group you are maintained in the material master ?

  • Settlement rule for Maintenance item

    Hi All,
    When i attempting to create a settlement rule Using a WBS element for Maintenance Item System showing
    Error Message "No Object Status is available for MIT#1'.
    Thanks & Kind Regards

    Sri Vas,
       Is this specific to a particular WBS element or does it happen for ANY WBS element? The WBS element may not have been setup properly.Check the same WBS element directly by going to the WBS element change transaction.Also check the account assignment and status of the WBS element that Ramesh had suggested. If the WBS element has been defined properly,Try changing the settlement rule to a cost center  and see if you still get this error.
    Regards
    Narasimhan

Maybe you are looking for

  • Z 10 Amazing But Missing Useful Functions

    The Z10 phone is an amazing change for the blackberry users and it shows that the company is going on a great track and an amazing future, although am impressed with the phone and using it as my primary phone, it needs the missing functions that most

  • How do I sync my 3rd gen ipod touch after installing the latest version of itunes?

    How do I sync my 3rd gen ipod touch after installing the latest version of itunes?

  • IPOD To Wireless Connection

    Merry Xmas to ALL- Son has a new IPOD touch and is trying to connect to wireless connection in the house.The Ipod asks for the password to this connection, I have forgotten it. What can I do? Many thanks.

  • XML Forms rendering

    Hi, I am storing some documents created from XML forms into a new repository created by us in KM. while opening this document from our repository, the content is opened in normal XML file format, instead of expected XML form renderer. But if I choose

  • Changing Password for Users

    Hi All, I am using External Table Authentication for my users.I have created users along with their password in the database table.The problem arises when I am trying to change the password for the users in "My Account" page of the Presentation Servi