Check sales order exits for category ZTAC

Hi Experts
I have a requirement to modify the iDOC interfaced program,
In the routien which checks for the existence of a production order, I have to modify the following
1.  Inspect each item on the sales order
2. If (and only if) there is atleast one item with a category of "ZTAC" then check for a production order otherwise processing the order in the usual manner.
Could anyone tell me how to check (Is there a sales order) if no then display error message if yes then is there a production order if no display error message if yes Create confirmation .......................
I want to know how to write a coding to check sales order exits from table VBAP,VBAK Etc., .
Thanks in Advanced
Regards
Piroz

Hi Prabhu
Thanks for your email and response but I need to check this in program for IDOC ....Modification
Insert code in this way
check sales order for category = 'ZTAN' inspect for each item on sales order
and if you found item with cateogry ZTAN then check for production order otherwise go asual manner
I WANT TO WRITE A CODING HERE **********************
  if production order required then check
                for each item on sales order item list
                      with item category = 'ZTAC' then
                                 return true
                            next
                              end function
  VBAP TABLE field VBELN and PSTYV (ZTAC,ZTAN Etc)
Eg of coding
if lva_saleord is initial
        select single * from vbap into l_saleord
          where vbelv = lva_saleord
          and   vbeln = lva_vbeln and
          exit.
        endselect.
      endif.
I want to write a small program in between to check the sales order exits if it is then I have to go to deliveries ...................
Regards
Eslam

Similar Messages

  • Insert code in prgram to check sales order exits in your own program

    Hi Experts
    I want to insert a coding in IDOC , can anyone write in abap coding and show .....The program is to check if sales order for category PSTYV ( CATEGORY ) for items ...
    if found set flag true else set flag false...
    Eg
    clear flag
    insert code
    to check s/o for ZTAC item found
    if found
    set flag = true
    else
    set flag = false
    So how can I write a a code in ABAP
    Thanks in advanced
    Piroz

    Hi Fracis
    Thanks for your advice I did in this way ,  Is there any correction required
    form look_sap_saleord  using    p_in_string
                                    p_material_in          " Material No exits
                                    p_site_in              " plant
                           changing p_out_saleord_e        " sales order
                                    p_out_material_e       " Mat No
                                    p_out_order_e          " Prod Order
                                    p_out_wemng_e          " QTY goods received for order item
                                    p_out_psmng_e.         " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
    CHECK FOR SALES ORDER IN VBAP IF EXITS
    GO TO DELIVERES
    ELSE CHECK REQUIRED PRODUCTION ORDER
           ihrez_e Ship to party
    check single if the sales order exits
      select vbeln from vbkd into vbkd-vbeln
        where ihrez_e eq p_in_string.
      Is the sales order exits for ZTAN Category ?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbkd-vbeln and
                werks eq p_site_in and
                matnr eq p_material_in and
                pstyv = 'ZTAN'.
        The sales order is for the specified plant.
          lva_saleord = vbap-vbeln.
          lva_prodmat = vbap-matnr.
          exit.
        endselect.
      when an order for this plant has been found.
        if not lva_saleord is initial.
        exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from vbap
        where vbeln = lva_saleord.
      if lva_count eq 1.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord and
                matnr = p_material_in and
                pstyv = 'ZTAN'.
          exit.
        endselect.
      else.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
       move: lva_saleord to p_out_saleord_e,           " sales order
             lva_prodord to p_out_order_e,             " production order
             lva_prodmat to p_out_material_e,          " material no
             lva_psmng   to p_out_psmng_e,             " QTY Ordered
             lva_wemng   to p_out_wemng_e.             " Qty Received goods
            lva_wemng   to p_out_wemng_e.             " Quantity of goods received for the order item
    endform.                    " look_sap_sales ord
    Regards

  • Sales Order Exit For Item Texts

    Hello all,
    I am having a very wierd issue with sales orders.
    I am creating an exit to redeterming item category of line item via the item usage field.
    The item usage field is a user defined field on the "Additional Data B" in the Sales Order.
    In MV45AFZZ, I am able to set the item category after the item usage is entered.
    Now the Item text nodes in the "Texts" tab at line item level depend on the item category.
    Thus item category ABCD has text T1 T2 & T3 assigned to it
    while item category EFGH has text T1 & T5 Assigned.
    My issue is that when the item category is changed from ABCD to EFGH, if one goes to the "Texts" Tab at line item level, the nodes shown are the same as those for item category ABCD.
    I cant find any exit to redetermine the text sequence.
    I tried USEREXIT_MOVE_FIELD_TO_TVCOM_I & TVCOM_H but they dont seem to work.
    I would really be very grateful for any help/ideas on how to get this resolved.
    Many Thanks,
    Preet

    Hello,
    Actually I dont need to either rename the text or change the contents (please correct me if wrong).
    Basically if PSTYV (itm_cat) = ABCD then text id's
    0001      Desc1
    0002      Desc2
    0003      Desc3
    0004      Desc4
    are shown.
    If PSTYV = 'EFGH' then text id's
    ID Node    Description
    0001       Desc1
    0006       Desc6
    0008       Desc8
    are to be shown ( this is what I want ).
    However right now if I change Item category from ABCD to EFGH then the nodes on the "Text Tab are
    0001       Desc1
    0002       No Description Shown
    0003       No Description Shown
    0004       No Description Shown
    0006       Desc6
    0008       Desc8
    I cant get a screenshot which would probably explain it better.
    In short is there any way of not displaying specific test-id's in the long texts for line items.
    I realise its a Friday here but any help will be deeply ..deeply appreciated.
    Many Thanks,
    Preet

  • Sales Order Exit : for defining the invalid Order reason.

    Hi all,
    I am looking for an exit that may cnotain code for defining invalid entries of order reason AUGRU.
    In VA01 , in my system, while creating order , we give order reason. But these reasons have been categorized as valid or invalid.
    Basically when we go in VA01 and give order reason then, there is a Z field that determines which order reasons are invalid. It is this code I want to reach. Can anyone give any idea which exit it could be or how I could look for it.
    thanks in
    Edited by: Inesha9 on Jun 22, 2011 9:05 AM

    Hi,
    It seems, you want to validate AUGRU of VBAK
    For that try with USEREXIT_CHECK_VBAK in include MV45AFZB.
    Another thing, there is z field u are talking about. Is this Z field is a part of VBAK ?
    Let us know, if it helps you. Thanks

  • Sales Order - Reasons for material Nr and item category being disabled

    Hello,
    In some of our sales orders items (without subsequent documents), SAP disables fields Material Nr and Item Category. Can you please help on the reasons for this? Please note that we do not use configurable materials.
    Regards,
    Joã

    Hi,
    The material number will always comes greyed out in standard SAP. You cannot change the material number. If you want to change it, you have to delete the line as a whole and then introduce a new line with new material.
    For the item category field, it is either greyed out or available for editing based on the configuration done in the tcode VOV4. For the sales order type, item category group etc.....if you maintain only one item category as the default IC, then this field will be greyed out after populating the default I.C. If there are alternate I.Cs maintained here, then this field is available for editing. Please check this once.

  • Restriction for Sales orders due account category

    Hi All
    I want restrict some sales order types due type of account (individual or corporate). For example when i creating order of type A , it must can only been created with assignment of corporate account. Does anybody solved this problem? It's doesn't seem very complicated but i have no clue at all.
    Regards,
    EL

    Hi Raghu
    Thanks for the reply...I was looking to get a list of sales orders due for billing, rather than checking for the status of a single one.
    Are you suggesting I do a query on VBUP table?
    Cheers
    /Arun

  • Calling "Check Sales Order" on HU2 fails

    Hello,
    I'm trying to use the ES "Check Sales Order" (Manage Sales Order In) on HU2, by providing the minimal required information (ProcessingTypeCode, BuyerParty and SalesOrganisationID/DistributionChannelCode/DivisionCode).
    Calling the ES returns an error "[040(SLS_LORD)] Document type TA does not support user status" (I'm using Order type "OR").
    I also tried to use a couple of other order types (RO, TAV, ...) without success.
    The same information used with "Create Sales Order" would work.
    I have the feeling that it is more likely a role/permission issue.
    Is the "Check Sales Order" ES forbidden to standard users ?
    Any way to confirm/solve this ?
    Any other order type ?
    Thanks,
    Nicolas.

    Hi Prabhu
    Thanks for your email and response but I need to check this in program for IDOC ....Modification
    Insert code in this way
    check sales order for category = 'ZTAN' inspect for each item on sales order
    and if you found item with cateogry ZTAN then check for production order otherwise go asual manner
    I WANT TO WRITE A CODING HERE **********************
      if production order required then check
                    for each item on sales order item list
                          with item category = 'ZTAC' then
                                     return true
                                next
                                  end function
      VBAP TABLE field VBELN and PSTYV (ZTAC,ZTAN Etc)
    Eg of coding
    if lva_saleord is initial
            select single * from vbap into l_saleord
              where vbelv = lva_saleord
              and   vbeln = lva_vbeln and
              exit.
            endselect.
          endif.
    I want to write a small program in between to check the sales order exits if it is then I have to go to deliveries ...................
    Regards
    Eslam

  • Ignore Production order if sales order exits

    Hi Experts
    I want to check some validation for sales order , The system goes in this way  ...I have to modify in this way
    we are extracting the command orders from Command QC System and inserting into SAP . Once it is extracted the Interface coding was written.....to extract sales order, production order etc.,
    Now I want to check only those records in which category are ZTAN. because some time in our company they will sold pigments which does not contain production order directly it will check for qty and delivered to customer.
    Select * from VBAP where VBELN = 'SALES ORDER' and
             MATNR = 'Material nO' and
             PSTYV = 'ZTAN'
    This is because it should not check the production order in AFPO table it must directly go to create deliveries etc for that I created to check sales order ignoring production order So can anyone help me to modify the below coding to check only sales order bu
    SALES ORDER EXITS MODIFICATION****************
    *&      Form  find_sap_salord Exits
          Find an SAP production order for a material.
         -->P_IN_STRING    COMMAND order number
         -->P_MATERIAL_IN  Material number in
         -->P_SITE_IN      Material number in
         <--P_OUT_SALEORD  Sales order number
         <--P_OUT_MATERIAL Material number out
         <--P_OUT_ORDER    Production order number
    form look_sap_saleord  using    p_in_string         " 
                                    p_material_in       " Material No exits
                                    p_site_in           " plant
                           changing p_out_saleord       " sales order
                                    p_out_material      " Material No
                                    p_out_order         " Prod Order
                                    p_out_wemng         " Qty of Goods Rec for Order Item
                                    p_out_psmng.        " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
           ihrez_e Ship to party       
      select vbeln from vbkd into vbkd-vbeln
       where ihrez_e eq p_in_string.
      select vbeln from vbap into vbap-vbeln
        where vbeln eq p_in_string.
      Is the order for the specified plant?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbap-vbeln and
                matnr eq vbap-p_material_in and
                pstyv in ('ZTAN')
          and   werks eq p_site_in.
        The order is for the specified plant.
          lva_saleord = vbap-vbeln.
          exit.
        endselect.
      Exit when an order for this plant has been found.
        if not lva_saleord is initial.
          exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from afpo
        where kdauf = lva_saleord.
      if lva_count eq 1.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord.
          exit.
        endselect.
      else.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
      move: lva_saleord to p_out_saleord,
            lva_prodord to p_out_order,
            lva_prodmat to p_out_material,
            lva_psmng   to p_out_psmng,
            lva_wemng   to p_out_wemng.
    endform.                    " find_sap_prodord
    END OF MODIFICATION 22/09/2008*******

    Thanks  thread close
    Piroz

  • Sale order with item category TAN not getting displayed in md04

    Hi,
    We have a sale order with item category TAN, Schedule line category CP, MRP type ND and availability check as 07. This is not getting reflected in md04. But item category TAB gets displayed under the PR number.
    Please let me know what checks to be made or changes to be done for the sale order with item category TAN to get displayed in md04 screen
    Thanks & Regards

    Hi all,
    I changed the MRP type to PD, and from the next sale order, line item onwards, it was getting displayed in md04 screen. The already created one anyway dint get reflected. So I had to delete the line item and create a new one.
    Thanks all for the help
    Regards,
    Jegashree

  • Block the Material at Item level in Sales Order automatically for delivery

    Hi!
    My business scenario needs a material to be Ckecked for Inspection after raising the Sales Order by thirdparty person. So, I need to block that particular material at Item level automatically for delivery and rest of the line items can get delivered. I can do this by selecting the reason for Block at Item level manually, but I want the system to get detemine this block. And one more thing is that there is NO Quality Management module for this. So, let me know what I need to configure for this effect.   Thank you.....

    hi,
    pl check the user exit " userexit_save_document_prepare" or "userexit_save_document".
    Take the help of your abaper to see if the logic written here can affect the item level block in the sales order for inspection. Create new reason for the item level block and have it triggered with this exit. Instead of hard coding which might require regular intervention of abaper for code changes for the business to be able to manage it, maintain a master data in the material master against some field with a key.
    now use that key to identify if these materials require to be blocked at the sales order level for inspection. To release this item again the user has to go in VA02 mode to release the block. Let this be done after the inspection of that material.
    regards
    sadhu kishore

  • Workflow identification in Sales Order Exit

    Hi,
    In my Sales order exit, under some conditions Iam raising an error message, when the order is being created in background this order will move to workflow. Now if any one process this order through the workflow i want to allow the order to get posted with out raising my exception.
       So I would like to know how I can identify whether my order is being posted through the workflow or directly, in the Sales order exit code.
    Thanks in advance friends,
    Anvitha.

    Hi friends,
    Thanks for your response.
    Checking whether the order is posted in Background or foreground doesn't solve my problem, because my order may be posted in Background or foreground. But when the order is processed through workflow, the processing option depends on the configuration of the Workflow object type. So SY-BATCH doesn't serve my purpose.
       Coming to using SY-UNAME, I observed that the value during the Order process through Workflow is the UserID who process it. So i can't distinguish it.
    Friends, any one had any other option to identify whether the order is being posted through Workflow.
    please help me out.
    Regards,
    Anvitha.

  • Sales Order Confirmation when sales order goes for Credit Block

    want Sales Order to be Confirmed , i e Schedule line Confirmation , when sales order goes for Credit Block
    How i can Achieve this?
    Even when set for Sales Document typpe credit check as 'D' and credit group as ;03; ie at Goods Issue still order is not getting confirmed.

    I am not sure, why you want schedule line to be confirmed for credit blocked sales orders. Re-confirm with the client.
    There are controls when defining delivery blocks.
    Goto IMG - Log.Execution-Shipping - Deliveries- Define delivery blocks( check menu path in system, may not be same as shown here).
    Select 01- credit block " untick" from "Confirmation" Column.
    Now test with & see how ti works.
    Regards,
    Reazuddin MD

  • Route not determing automatically at sales order level for some sales order

    Dear All ,
    Route not determing automatically at sales order level  for some sales orders.We are using automatic route determination without wt group,eventhough we have configured the required settings
    I have checked all the forums but didn't find any solution for the same.
    Looking for your inputs .
    Thanks inadvance
    Regards
    Venkat

    Hi
    1. Copare the Routes which are Automatically determined and which are not automatically determined
    2. Have you mainted this route to be RELEVANT FOR TRANSPORTATION without this check route will not get picked up.
    SPRO > Logistic General > Shipping > Basic Shipping Function > Routes > Define Routes > Define Routes and stages > Select the Route and check for it's settings > CHECK MARK Relevant for Transport. Without this check the route will not get picked up as of my understanding.
    Thanks
    RB

  • Deliery block sales orders report for TAS items

    Hi,
    User requirement is need a report which gives list of sales orders which have the delivery block in  sales order schedule lines.( of third party items TAS)
    I found V.14 and VA14L to find out the sales orders which give the list of sales orders which are blocked for outbound delivery (in schedule line delivery block).
    However, for third party items sales order with item category TAS are not coming in the report of V.14.
    I think the reason is because of the third party items are not relevant for delivery hence v.14 report not fetching the data of third party orders(TAS), is this my understanding is correct?
    If the user is insisting on for even third party items also they want a report which should give the list of sales order which are blocked for delivery block then what is the best way to advise the user?
    And does it make any sense putting delivery block for third party items ? because we are not delivering the goods to customer and even if you put delivery block we can’t stop PR,PO and MIGO and MIRO etc .
    Thanks,

    is this my understanding is correct?
    Absolutely correct.
    they want a report which should give the list of sales order which are blocked for delivery block
    Since the inventory / stock of material would be handled out of SAP, what is the need to set a delivery block.  Even if you set delivery block, vendor is going to deliver the material.
    what is the best way to advise the user?
    Convince the user what they are expecting in SAP are logically incorrect.  When the material is being delivered by a vendor, what is the use if you set delivery block for this item?  What they are going to achieve. 
    And does it make any sense putting delivery block for third party items ?
    Definitely, no
    G. Lakshmipathi

  • Valuated sales order stock for configured material

    Hi All!
    I have a small problem   : I created a new type of material (OMS2) - a configurable one, managed on quantity and value basis. I work with valuated sales order stock for configurable materials but the account in the purchase requisition is determined by means of event key GBB insted of event key BSX.
    Where is my error?
    Any idea would be appreciated.
    Florina C

    Hi
    I think you are talking about Special Stock "E"...ie) Sale Order Stock...
    If my understanding is correct then,
    If you go and see the Table T156....For the
    Movement Type: 101,
    Special stock Indicator : E,
    Qty. Updation Checked,
    Val. Updation Checked,
    Movement Indicator : Against PO,
    Consumption Indicator: Sales Order Stock.....combination....the transaction Event Key....GBB only has been Assigned....these  settings you cannot change...
    This linkage you can view in OLMW-----> Account Determination -
    > Acc. Determination W/O Wizard -
    >Account Grouping....also
    Reward if useful
    Regards
    S.Baskaran
    Edited by: baskaran srinivasan on Dec 20, 2007 12:18 PM

Maybe you are looking for

  • Having trouble setting up sync on 4.0b3pre from 12-2-2010

    I just got a Nook Simple Touch. I rooted it with NookManager. It is running Android 2.1. I use Swapper2 to expand the RAM to 512. The 4.0b3pre build from 12-2-2010 is the last version that will install on this device; so, that is what I am running. W

  • Your Experience with RSSM / compatibility mode in BW 3.X ?

    Hi Folks, we have a dozen of InfoObjects referencing 0costcenter. These Objects are used in several InfoProviders and queries. We also have more than 500 authorizations definitions for hierarchies, at the time being defined on 0costcenter. This all w

  • Connecting TVIX 6500M to Time Capsule FW7.4.2

    Hi, I cannot connect to my time capsule (fw7.4.2) using my mediabox TVIX 6500M. I used to be able to when using FW 7.3.2 but it was broken after FW 7.4.1. I set up an account on the time capsule disk and i access it from the mediabox. That was FW 7.3

  • Copy roto selection to same position in all frames

    I am using AE CS5 in Production Premium. I also have moca AE 3.1 that may be a better way of trying to isolate an object using planar tracking.  I need to replace an item that appears in the same position on all frames of a clip.  This is a previous

  • Workflow customizing error

    Hi, When i run the auto customizing for workflow i get the following error: Log Entry  -   Output device "" not known                       Execution -  Automatic Component - SAP_BASIS Activity - Schedule Background Job for Missed Deadlines I have ch