Sp transaction notification On purchase Order -help

Hi ,
I need to enter owner Name in every purchase order , condition to set if its is blank Po cannot be able to Add.
I am trying to execute the Sp notification as following , but cannot able to the restrict the Owner name . I am able to create the purchase order without any notification.
{IF @object_type = N'20' AND ( @transaction_type = N'A' OR @transaction_type = N'U')
BEGIN
if exists (SELECT OwnerCode from OINV where DocEntry=@list_of_cols_val_tab_del and (OwnerCode is null or OwnerCode=''))
BEGIN
SELECT @Error = 2
SELECT @error_message = 'OwnerCode should not be BlAnk'
END
END }

Hi,
Hendry is right.
Try:
IF @object_type = '22' AND @transaction_type in ('A','U')
BEGIN
IF exists (SELECT DocEntry from OPOR where DocEntry=@list_of_cols_val_tab_del and (OwnerCode is null or OwnerCode=''))
BEGIN
SELECT @Error = 22
SELECT @error_message = 'OwnerCode should not be BlAnk'
END
END
Thanks,
Gordon

Similar Messages

  • Fast entry transaction for entering purchase order confirmations

    Does anyone know of fast entry transaction for entering purchase order confirmations similar to VL31N for inbound deliveries?
    Thanks

    dear John,
    if i m not mistaken you want to give confirmation control to your existing POs.
    If the case is this you can opt for a BDC to be run for updation.
    Ask your abaper to do this thing.
    revert back if this is not the the case.
    Njoy
    Ashish

  • Sp Transaction Procedure For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hello Amit,
    You don't need post identical thread twice. This SP related discussion is usually posted on main forum.
    Please close this one.
    Thanks,
    Gordon

  • Sp_Transaction Notification For Purchase Order Item Checking

    Hello All,
    I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
    with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
    Example:-
    Doc No.  Vendor   Item Code
    1                A            ERT
    Is added
    Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
    'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
    This checking will be done for each line item of currently entered Purchase Order Document.
    Thanks ,
    Amit

    Hi Amit,
    i found this on forum. Try this,
    if @object_type = N'22' and @transaction_type in (N'A', N'U')
    begin
    declare @line1 int
    declare @lin1 int
    declare @out1 int
    Set @out1 = 0
    SET @lin1 = 0
    Declare @Vend as varchar(200)
    Declare @ItemCode as varchar(200)
    Select @Vend = CardCode From OPOR Where DocEntry = @list_of_cols_val_tab_del
    Select @line1 = Max (LineNum)FROM POR1 WHERE POR1.DocEntry = @list_of_cols_val_tab_del
    While @lin1 < @line1
    Begin
         Select @ItemCode=ItemCode From POR1 Where DocEntry=@list_of_cols_val_tab_del and LineNum = @lin1
          if (SELECT COUNT(T0.DocEntry) FROM POR1 T0 inner join OPOR T1 on T0.DocEntry = T1.DocEntry
          WHERE T0.ItemCode = @ItemCode and T1.CardCode = @Vend)> 1
          Begin
               Set @Out1 = 1
               Break;
          END
               Else
               Begin
               Set @lin1 = @lin1+1
               Continue
          END
    END
    Set @lin1 = @lin1 + 1
    if @out1 = 1
    begin
          Set @error = 1
          Set @error_message = 'Item Code in line ' + CONVERT(nvarchar(4), @lin1) + N'already Exists For This Vendor!'
    End
    END
    Check this too Stored procedure in purchase order for duplicate item for a vendor
    Thanks,
    Joseph
    Edited by: Joseph Antony on Jan 11, 2011 1:37 PM

  • Transaction ME23N; Create purchase order- Account assignment tab

    Hello , do you know in which table the info for account assignment for a purchase order is kept?
    e.g just like EKBE is used for Purchase order history.
    thx.

    Table Description u2013 All Tables: Purchasing
    EBAN  Purchase Requisition 
    EBKN  Purchase Requisition Account Assignment 
    EBUB  Index for Stock Transport Requisitions for Materi
    EINA  Purchasing Info Record: General Data 
    EINE  Purchasing Info Record: Purchasing Organization D
    EIPA  Order Price History: Info Record 
    EKAB  Release Documentation 
    EKAN  Vendor Address: Purchasing Document 
    EKBE  History per Purchasing Document 
    EKBEH  Removed PO History Records 
    EKBZ  History per Purchasing Document: Delivery Costs 
    EKBZH  History per Purchasing Document: Delivery Costs 
    EKEH  Scheduling Agreement Release Documentation 
    EKEK  Header Data for Scheduling Agreement Releases 
    EKES  Vendor Confirmations 
    EKET  Scheduling Agreement Schedule Lines 
    EKETH  Scheduling Agreement Schedules: History Tables 
    EKKI  Purchasing Condition Index 
    EKKN  Account Assignment in Purchasing Document 
    EKKO  Purchasing Document Header 
    EKPA  Partner Roles in Purchasing 
    EKPB  "Material Provided" Item in Purchasing Document 
    EKPO  Purchasing Document Item 
    EKPV  Shipping Specific Data on Stock Tfr. for Purch. D 
    EKRS  ERS Procedure: Goods (Merchandise) Movements to b 
    EKUB  Index for Stock Transport Orders for Material 
    EORD  Purchasing Source List 
    EQUK  Quota File: Header 
    EQUP  Quota File: Item 
    T- Tables
    T024  Purchasing Groups 
    T024E  Purchasing Organizations 
    T024W  Valid Purchasing Organizations for Plant 
    T024Z  Purchasing Organizations 
    T027A  Shipping Instructions, Purchasing 
    T027B  Texts: Shipping Instructions 
    T027C  Codes for Compliance with Shipping Instructions 
    T027D  Compliance with Shipping Instructions: Texts 
    T069  Certificate Categories 
    T069Q  Control Data for Source Determination and Checkin 
    T069T  Certificate Categories: Text Description 
    T160  SAP Transaction Control, Purchasing 
    T160B  SAP Transaction Control, List Displays, Purchasin 
    T160C  SAP Transaction Control for List Displays in CALL 
    T160D  Function Authorizations: Purchase Order 
    T160E  Function Authorizations: Purchasing: Descriptions
    T160I  Control of Intrastat Reports 
    T160J  Text Table for Intrastat Reports 
    T160L  Scope of Purchasing Lists 
    T160M  Message Control: Purchasing (System Messages) 
    T160O  Description of Scope of List 
    T160P  Entities Table Routines 
    T160Q  Scope of List: Buyeru2019s Negotiation Sheet: Routine
    T160R  Routines for Buyeru2019s Negotiation Sheet 
    T160S  Selection Parameters for Purchasing Lists 
    T160T  Description of Selection Parameters 
    T160V  Default Values for Purchasing 
    T160W  Description for Default Values for Purchasing Ope
    T160X  Scope of List: Buyeru2019s Negotiation Sheet 
    T160Y  Scope of List: Buyeru2019s Negotiation Sheet: Descrip
    T161  Purchasing Document Types 
    T161A  Linkage of Requisition Doc. Type to Purchasing Do
    T161B  Default Business Transaction Type for Import 
    T161E  Release Codes 
    T161F  Release Point Assignment for Purchase Requisition
    T161G  Release Prerequisite, Purchase Requisition 
    T161H  Fields for Release Procedure, Purchase Requisitio
    T161I  Determination of Release Strategy 
    T161M  FineTuned Control: Message Types 
    T161N  Message Determination Schemas: Assignment 
    T161P  Check of Document Type, Document Category, Item C
    T161R  REORG Control, Purchasing 
    T161S  Release Indicator, Purchase Requisition 
    T161T  Texts for Purchasing Document Types 
    T161U  Texts for Release Indicator 
    T161V  Shipping Specific Data for Stock Tfr. for Purch. 
    T161W  Order Types for Stock Transfer 
    T161Z  Additional Checks for Outline Agreements on Reorg
    T162  Field Selection, Purchasing Document 
    T162K  Field Selection, Account Assignment Fields, Purch
    T162T  Description of Field Selection Reference Key 
    T162X  Description of Field Groups from T162/T162K 
    T162Y  Groups: Field Selection 
    T163  Item Categories in Purchasing Document 
    T163A  Check Item Category/Account Assignment Category 
    T163B  Purchase Order History Categories 
    T163C  Texts for Purchase Order History Categories 
    T163D  Assignment Internal/External Confirmation Categor
    T163E  Confirmation Categories 
    T163F  Confirmation Categories: Descriptions 
    T163G  Confirmation Control 
    T163I  Texts for Account Assignment Categories 
    T163K  Account Assignment Categories in Purchasing Docum
    T163KS  Assignment of Tax Indicator to Account Assignment
    T163L  Confirmation Control Keys 
    T163M  Confirmation Control Keys: Description 
    T163P  Release Creation Profile 
    T163S  Description for Release Creation Profile 
    T163X  "Zombie" T163X 
    T163Y  Texts for Item Categories 
    T165K  Copying Options: Header Texts 
    T165P  Copying Options: Item texts 
    T166A  Supplement Text in Purchasing Document Printouts 
    T166C  Print Relevant Purchasing Document Changes 
    T166K  Header Texts in Purchasing Document Printouts 
    T166P  Item Texts in Purchasing Document Printouts 
    T166T  Change Texts in Purchasing Document Printouts 
    T166U  Headings in Purchasing Document Printout 
    T167  Number Range Management for Purchasing Master Dat 
    T167T  Transaction Description 
    T168  Screen Control, Purchasing 
    T168F  Function Codes, Purchasing 
    T168T  Screen Titles 
    T16FB  Release Indicators: Purchasing Document 
    T16FC  Release Codes 
    T16FD  Description of Release Codes 
    T16FE  Descriptions of Release Indicators: Purchasing Do 
    T16FG  Release Groups 
    T16FH  Descriptions of Release Groups 
    T16FK  Release Statuses 
    T16FS  Release Strategies

  • Transaction Code for Purchase Order with Network, Activity, and Element

    I have been asked for a transaction code that will allow the user to view the Purchase Order, Network, Activity, and Element on the same transaction.  I have been able to use CN41 to get them the Purchase Requisition, Network, Activity, and Element, but cannot seem to find one for the Purchase Order. 
    I feel like this should be easy...
    Any ideas?

    Hi,
    I would recommend you to test BAdI ME_PROCESS_PO_CUST.
    Regards,
    Edit

  • Create Sales order with reference to purchase order - Help needed

    Hi Gurus
    Purchase order is being created in Oracle system. SAP system will receive the purchase order and creates the sales order for the corresponding purchase order.
    Hoe to create sales order, Through BAPI or through IDOC. Please suggest and give some pointers of existing interface
    Thanks
    Andy.

    Hi,
        If you are working on ECC6.0 check for the BAPI BAPI_SALESORDER_CREATEFROMDAT1 .You can also pass the purchase order number .
    Check the sample code
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    *Purchase order number
    header-PURCH_NO_C =  '4000006'.
    headerx-PURCH_NO_C = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    Reward points if it worked.
    Regards,
    Abhishek
    Edited by: Abhishek Raj on May 14, 2008 9:57 AM

  • Email Notification of Purchase Order

    Hi Gurus
    We are on SAP 4.7 doing an MM implementation.
    We have the following requirement: We have 2 levels of PO release. When the PO is created or changed, an email notification should be sent to the person responsible for 1st release. When the 1st release is carried out, then an email notification should be sent to the person responsible for 2nd release.
    Pls advise on how to get this going.
    Thanks in advance

    Hi,
    You need to look for releasing purchasing documents with workflow.
    http://help.sap.com/saphelp_47x200/helpdata/en/1d/ea9d9c7aca11d194b70000e82dec10/frameset.htm
    Here is how the workflow works.
    http://help.sap.com/saphelp_47x200/helpdata/en/1d/ea9d9c7aca11d194b70000e82dec10/frameset.htm
    Cheers
    Arun.

  • Upload documents from transactional screen - Sale & Purchase Order

    hi All,
    I am trying to have DMS attachment from trx - VA02 directly. I have come across few links which say - this is possible.
    upload documents from user transactional screen to content storage area | LinkedIn
    I am able to get the functionality for CJ20N - 'WBS Element' Object (Screenshot attached). Can someone pl suggest if I am missing something to get the same functionality for Sale Order / PR & PO.
    For Sale Order - I believe the 'Create' icon shall be 'Enabled' once I navigate - Extras -> Documents.
    -thanks

    Hi
    This button is only displayed if you use the new screen logic (see note 1066915) and when you have maintained the necessary customizing for the required document types and objects in transaction DC10.
    So I would kindly ask you to go to transaction DC10 and mark a document type where the necessary object is linked under 'Define object links'. Choose the right object and display its details by double-click. Then you will see the field 'Create document' where you have to enter a value '1' (using transaction) or '2' (simple creation). Please enter a value and flag the 'Additional function' checkbox too.
    /Tilak

  • Long text field for Purchase Order help

    Hey guys,
    First, I'm VERY new to ABAP/SRM in general.  So please be patient with me.
    We have users who are entering additional text comments into SRM (when creating a new PO).
    The problem is...when they enter the text and hit <ENTER> I am getting it on the SCC side as "#" seperating the lines.
    For example...
    User types
    line 1
    line 2
    line 3
    It is appearing as line 1#line 2#line 3
    I've done some debugging, and found the filed it is referring to:
    IS_OBJECT-SC-LONGTEXT and the field is TDLINE
    But I have no idea how to fix this...is this something I can change?  We don't want to change SAP code...is there a BADI I can access???  Anything?

    Hello,
    To look for SAP OSS notes, you need a user and his password to access to SAP website:
    [http://service.sap.com/support]
    If you don't have it, ask for your team leader to give you one.
    Regards.
    Laurent.

  • About ALE transaction set 860 (purchase orders) and Idoc type ORDERS05.

    Hi all,
    What is the mapping between the two? How can I find more about the two..
    Thanks,
    Charles.
    +++++++++++++++++++++

    Hi,
    Guess it looks like the output is getting proposed but its not getting processed. Check the output type configuration. Check the TIme Settings in the output type configuration.
    It is possible to set the Time when the output must be processed. Is it on SAVE or is it set to other settings. If its set to via background job then the background job must be run to process the output types.
    Check and let me know if all is fine at the output type configuration.
    Cheers
    VJ

  • Z Report of Transaction ME28.(Release Purchase Order)

    Dear all,
                   I want to make Z Report for the Transaction ME28 (Release Purchase Order).
    I am facing problem of GUI status in my Z Report. Actually Report is not displaying like ME28.
    and all the menu and function keys are also not coming properly.
    So, pls suggest me good solution.
    Thanks & Regards,
    Sandip Sonar.

    I am attaching a copy of ME28. Please give it to your ABAP consultant.
    He should be able to do the needful:
    REPORT RM06EF00 NO STANDARD PAGE HEADING MESSAGE-ID ME.
           Anzeigen Einkaufsbelege zur Belegnummer                       *
    Tabellen                                                            *
    INCLUDE FM06LTO1.
    INCLUDE FM06LCFR.
    **table added t16fc  - SAPBY     6 Feb 98
    TABLES: T16FG, T16FS, T16FV, T16FE, RM06B, T160B, T16FC.
    DATA: BEGIN OF XEKPO OCCURS 100.
            INCLUDE STRUCTURE EKPO.
    DATA: END OF XEKPO.
    *- Interne Tabelle der Zustände -
    DATA: BEGIN OF ZUS OCCURS 10.
            INCLUDE STRUCTURE T16FV.
    DATA: END OF ZUS.
    DATA: BEGIN OF ZUSKEY,
             MANDT LIKE EKKO-MANDT,
             FRGGR LIKE EKKO-FRGGR,
             FRGSX LIKE EKKO-FRGSX,
          END OF ZUSKEY.
    Parameter und Select-Options                                        *
    PARAMETERS:     P_FRGCO LIKE T16FC-FRGCO OBLIGATORY.
    SELECT-OPTIONS: S_FRGGR FOR EKKO-FRGGR.
    PARAMETERS:     P_FRGSE LIKE RM06A-P_FRGSE DEFAULT 'X',
                    P_FRGRS LIKE RM06A-P_FRGRS,
                    P_FRGVO LIKE RM06A-P_FRGVO DEFAULT 'X',
    set default to 'X' to show items as well - SAPBY
                    P_MITPOS AS CHECKBOX DEFAULT 'X',
    set default to 'DEFAULT'  - SAPBY
                    LISTU LIKE T160O-LISTU DEFAULT 'DEFAULT'.
    SELECT-OPTIONS: S_BSTYP FOR EKKO-BSTYP,
                    S_EKORG FOR EKKO-EKORG,
                    S_EBELN FOR EKKO-EBELN MATCHCODE OBJECT MEKK
                                           MEMORY ID BES,
                    S_BSART FOR EKKO-BSART,
                    S_EKGRP FOR EKKO-EKGRP,
                    S_LIFNR FOR EKKO-LIFNR MATCHCODE OBJECT KRED,
                    S_RESWK FOR EKKO-RESWK,
                    S_BEDAT FOR EKKO-BEDAT.
    Hilfsfelder                                                         *
    INCLUDE FM06LCEK.
    DATA: XFRG1 LIKE EKKO-FRGZU,
          XFRG2 LIKE EKKO-FRGZU.
    DATA: XSELKB LIKE EKKO-BSTYP,
          XSELKK LIKE EKKO-BSTYP,
          XSELKL LIKE EKKO-BSTYP,
          XSELKA LIKE EKKO-BSTYP.
    FIELD-SYMBOLS: .
    DATA: HFDPOS LIKE SY-FDPOS.
    **workflow line added for workflow
    DATA : LAST_USER_COMMAND  LIKE SY-UCOMM.
    Intitialisierung                                                    *
    INITIALIZATION.
      PERFORM ANFORDERUNGSBILD(SAPFM06L) USING XSELKB XSELKK
                                               XSELKL XSELKA.
    lines 67, 70 and 73 commented out -SAPBY
    **listu = t160b-listu.
      S_BSTYP-SIGN = 'I'.
      S_BSTYP-OPTION = 'EQ'.
    **if xselkb ne space.
      S_BSTYP-LOW = 'F'.
      APPEND S_BSTYP.
    **endif.
      IF XSELKK NE SPACE.
        S_BSTYP-LOW = 'K'.
        APPEND S_BSTYP.
      ENDIF.
      IF XSELKL NE SPACE.
        S_BSTYP-LOW = 'L'.
        APPEND S_BSTYP.
      ENDIF.
      IF XSELKA NE SPACE.
        S_BSTYP-LOW = 'A'.
        APPEND S_BSTYP.
      ENDIF.
    next two lines added to default the release code
      IMPORT T16FC-FRGCO FROM MEMORY.
    get parameter id 'ZRC' field t16fc-frgco.
      P_FRGCO = T16FC-FRGCO.
    Seketionsbild                                                       *
    AT SELECTION-SCREEN ON LISTU.
      PERFORM LISTUMFANG(SAPFM06L) USING LISTU.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FRGCO.
      CALL FUNCTION 'HELP_VALUES_FRGAB'
           EXPORTING
                I_FRGOT = '2'
           IMPORTING
                E_FRGAB = P_FRGCO
           EXCEPTIONS
                OTHERS  = 1.
    AT SELECTION-SCREEN.
      CALL FUNCTION 'ME_REL_CHECK_MANY'
           EXPORTING
                I_FRGOT = '2'
                I_FRGCO = P_FRGCO
           TABLES
                T_FRGGR = S_FRGGR
                T_T16FV = ZUS.
    Beginn der Selektion                                                *
    START-OF-SELECTION.
      NOT_FOUND = 'X'.
      SET PF-STATUS 'FREI'.
      SET TITLEBAR '001' WITH P_FRGCO.
      PERFORM FRG_INIT(SAPFM06L) USING P_FRGCO P_MITPOS.
    *- Lesen Belegköpfe -
      SELECT * FROM EKKO APPENDING TABLE XEKKO
                         FOR ALL ENTRIES IN ZUS
                         WHERE FRGRL EQ 'X'
                           AND FRGGR EQ ZUS-FRGGR
                           AND FRGSX EQ ZUS-FRGSX
                           AND EBELN IN S_EBELN
                           AND BSTYP IN S_BSTYP
                           AND EKORG IN S_EKORG
                           AND LIFNR IN S_LIFNR
                           AND RESWK IN S_RESWK
                           AND BEDAT IN S_BEDAT
                           AND BSART IN S_BSART
                           AND EKGRP IN S_EKGRP
                           AND LOEKZ EQ SPACE.
      IF P_FRGRS NE SPACE.
        SELECT * FROM EKKO APPENDING TABLE XEKKO
                           FOR ALL ENTRIES IN ZUS
                           WHERE FRGRL EQ SPACE
                             AND FRGGR EQ ZUS-FRGGR
                             AND FRGSX EQ ZUS-FRGSX
                             AND EBELN IN S_EBELN
                             AND BSTYP IN S_BSTYP
                             AND EKORG IN S_EKORG
                             AND LIFNR IN S_LIFNR
                             AND RESWK IN S_RESWK
                             AND BEDAT IN S_BEDAT
                             AND BSART IN S_BSART
                             AND EKGRP IN S_EKGRP
                             AND LOEKZ EQ SPACE.
      ENDIF.
      SORT XEKKO.
    *- Prüfen Freigabevoraussetzungen -
      LOOP AT XEKKO.
        MOVE-CORRESPONDING XEKKO TO ZUSKEY.
        READ TABLE ZUS WITH KEY ZUSKEY BINARY SEARCH.
        CHECK SY-SUBRC EQ 0.
        XFRG1 = ZUS+9(8).
        XFRG2 = XEKKO-FRGZU.
        TRANSLATE XFRG2 USING 'X  +'.
        OVERLAY XFRG1 WITH XFRG2 ONLY '+'.
        SEARCH XFRG1 FOR 'X'.
    *---- Keine Freigabezuständigkeit -
        IF SY-SUBRC NE 0.
          DELETE XEKKO.
        ELSE.
    *---- Freigabestelle merken -
          HFDPOS = SY-FDPOS.
          ASSIGN XFRG2+SY-FDPOS(1) TO .
    *---- Freigabe bereits erfolgt -
          IF P_FRGRS EQ SPACE AND
              EQ SPACE.
            DELETE XEKKO.
          ELSE.
    *---- Freigabe noch nicht erfolgt -
            IF P_FRGSE EQ SPACE AND
                NE SPACE.
              DELETE XEKKO.
            ELSE.
    *---- Freigabevoraussetzung fehlt -
              IF XFRG1 CA '+' AND
                 P_FRGVO NE SPACE.
                DELETE XEKKO.
              ELSE.
                EKKO = XEKKO.
                PERFORM FRG_FEKKO_AUFBAUEN(SAPFM06L) USING HFDPOS.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SORT XEKKO.
    *- Lesen Belegpositionen -
      IF P_MITPOS NE SPACE.
        SELECT * FROM EKPO APPENDING TABLE XEKPO
                           FOR ALL ENTRIES IN XEKKO
                           WHERE EBELN EQ XEKKO-EBELN.
      ENDIF.
    *- Ausgabe -
      LOOP AT XEKKO.
        EKKO = XEKKO.
        PERFORM EKKO_ANSCHRIFT(SAPFM06L).
        PERFORM EKKO_AUSGABE(SAPFM06L).
        IF P_MITPOS NE SPACE.
          LOOP AT XEKPO WHERE EBELN EQ EKKO-EBELN.
            EKPO = XEKPO.
            PERFORM FC_ME_READ_HISTORY(SAPFM06L).
            PERFORM EKPO_AUSGABE(SAPFM06L).
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    Ende der Selektion                                                  *
    END-OF-SELECTION.
      IF NOT_FOUND NE SPACE.
        MESSAGE S260.
        IF SY-CALLD NE SPACE.
          LEAVE.
        ELSE.
          LEAVE TO TRANSACTION SY-TCODE.
        ENDIF.
      ENDIF.
      WRITE: /(81) SY-ULINE.
    OK-Code-Eingabe                                                     *
    AT USER-COMMAND.
    **workflow inserted 6 Feb 98 by SAPBY
        PERFORM WORKFLOW_AT_USER_COMMAND.
    INS GSB 18/02/2004 - check user approving is not user that create
    PO
    if sy-ucomm = 'FRGU' or sy-ucomm = 'FRGS'.
    loop at xekko.
      if xekko-ERNAM = sy-uname.
         CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
           EXPORTING
             TITEL              = 'Error'
    TEXTLINE1 = 'As the creator of this pruchase order you cannot approve it
    as well !'
        leave program.
      endif.
    endloop.
    endif.
      PERFORM USER_COMMAND(SAPFM06L).
    Seitenueberschrift                                                  *
    TOP-OF-PAGE.
      PERFORM TOP(SAPFM06L).
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM TOP(SAPFM06L).
    **& form workflow_at_user_command
    TEXT
    ---> p1  text
    <--  p2  text
    FORM WORKFLOW_AT_USER_COMMAND.
      IF LAST_USER_COMMAND IS INITIAL.
        LAST_USER_COMMAND = SY-UCOMM.
      ENDIF.
      IF SY-UCOMM EQ 'ZURU'.
         PERFORM TRIGGER_WORKFLOW.
      ENDIF.
      CASE SY-UCOMM.
        WHEN 'BU'.
          IF P_MITPOS EQ 'X'.
            CHECK LAST_USER_COMMAND <> 'FRGR'.
            PERFORM TRIGGER_WORKFLOW.
          ELSE.
            CHECK LAST_USER_COMMAND = 'FRGS'.
            PERFORM TRIGGER_WORKFLOW.
          ENDIF.
        WHEN 'FRGU'.
          PERFORM TRIGGER_WORKFLOW.
      ENDCASE.
      LAST_USER_COMMAND = SY-UCOMM.
    ENDFORM.
    **& form TRIGGER_WORKFLOW.
    TEXT
    ---> p1  text
    <--  p2  text
    FORM TRIGGER_WORKFLOW.
    DATA : BEGIN OF ZEKKO OCCURS 20.
              INCLUDE STRUCTURE ZEKKO.
    DATA : END OF ZEKKO.
    DATA : BEGIN OF YEKKO OCCURS 20.
              INCLUDE STRUCTURE ZEKKO.
    DATA : END OF YEKKO.
    DATA : WFBAN LIKE EKKO-EBELN,
           WFERN LIKE EKKO-ERNAM.
    CLEAR : WFBAN, WFERN.
    MOVE-CORRESPONDING XEKKO TO YEKKO.
    CONCATENATE YEKKO-FRGZU 'X' INTO YEKKO-FRGZU.
    APPEND YEKKO.
    MOVE-CORRESPONDING XEKKO TO ZEKKO.
    *XEKKO-KZ = 'F'.
    APPEND ZEKKO.
    SELECT SINGLE KOKRS KOSTL
         INTO (EKKN-KOKRS, EKKN-KOSTL)
         FROM EKKN
         WHERE EBELN = XEKKO-EBELN
         AND EBELP   = '00010'.
    if sy-subrc <> 0.                  " Cost centres not mandatory at XXX
      exit.
    endif.
    CALL FUNCTION 'Z_ME_REL_EVENT_EKKO'
         EXPORTING
              I_CALL_UPDKZ = 'F'
              I_WFBAN      = EKKO-EBELN
              I_FRGCO      = T16FC-FRGCO
              I_ERNAM      = SY-UNAME
              I_UCOMM      = SY-UCOMM
         TABLES
              I_EKKO_NEW   =  YEKKO
              I_EKKO_OLD   =  ZEKKO.
    ENDFORM.

  • Purchase order not create in sus

    Dear customizer,
    Ihave implemented a plan driven procurement with sus (r/3-sus) scenario,we have a problem when we transfer idoc from r/3 to sus.In sus sistem give me this error message
    "An error occured within an XI interface: Exception occurredE:BBP_PD:BBP_PD:051 -No address found for partner function type Sold-to Party E:BS:002 -"Create" is not allowed (SUS Purchase Order 4500000006 )CX_BBP_BD_ERROR===============CP; Include: CX_BBP_BD_ERROR===============CM002; Line: 57</FAULT_TEXT>"
    I hope in your answer.Thank best regards.
    Pernasetti Alessio

    Hi,
    Please check the following things.
    Check whether the roles delivered by SAP meet your requirements. If not, you can create new roles and assign transactions to them. We recommend that you copy standard roles and tailor them to your requirements.
    All users assigned to a respective role are then allowed to carry out the transactions. If required, you can refine the authorization check on the tab page Authorizations.
    Standard SAP Single-roles
    SAP_EC_SUS_ADMIN_PURCHASER (for purchasing administrators - SAP Supplier Self-Services)
    SAP_EC_SUS_BIDDER (for bidders - SAP Supplier Self-Services)
    SAP_EC_SUS_DISPATCHER (for dispatchers - SAP Supplier Self-Services)
    SAP_EC_SUS_INVOICER (for invoicers - SAP Supplier Self-Services)
    SAP_EC_SUS_ORDER_PROCESSOR (for order processors - SAP Supplier Self-Services)
    SAP_EC_SUS_MANAGER (for managers - SAP Supplier Self-Services)
    SAP_EC_SUS_SERVICE_AGENT (for service agents - SAP Supplier Self-Services)
    If you want to use SAP Supplier Self-Services, proceed as follows:
    1. Select one of the following single roles:
    SAP_EC_SUS_ADMIN_PURCHASER
    SAP_EC_SUS_ADMIN_VENDOR
    SAP_EC_SUS_BIDDER
    SAP_EC_SUS_DISPATCHER
    SAP_EC_SUS_INVOICER
    SAP_EC_SUS_MANAGER
    SAP_EC_SUS_ORDER_PROCESSOR
    SAP_EC_SUS_PRODUCT_MANAGER
    SAP_EC_SUS_SAR_PROCESSOR
    SAP_EC_SUS_SERVICE_AGENT
    SAP_EC_SUS_SERVICE_MANAGER
    2. Choose Change Roles.
    3. Choose the Personalization tab page.
    Note: The personalization applies to all roles, meaning the user can also create his own roles, for example copying the delivered SAP SUS roles. He can tailor these roles to his requirements by changing the SUS-specific attributes (BBP_SUS_ROLE_ATTRIBUTES).
    1. Select the entry BBP_SUS_ROLE_ATTRIBUTES (SUS-specific role attributes).
    2. Choose Change values.
    A dialog box for maintaining SUS-specific roles appears.
    3. If required, perform the following steps:
    If the role should be displayed in the SUS User Management (UM) and should be able to be assigned to the relevant user by the supplier administrator, set the indicator to display the role in SUS UM.
    If the user should be displayed as a service agent for the purchaser, set the Service agent indicator.
    If you want to define the user as an SRM administrator, set the SRM administrator indicator. The user is then authorized to change all supplier data.
    If want to assign the role SUS administrator automatically to the user during registration, set the SUS administratorindicator.
    Sets the relevant indicators if you want users to receive the following notifications: Notification If Purchase Order Not Opened, Notification If Purchase Order Response Is Missing, Notification If ASN Is Missing, Notification If ConfirmationIs Missing, Notification If Invoice Is Missing,
    Award the points for the help.
    BR,
    Vijay Mittal

  • Purchase order related for invoice...

    hello all im workin on transaction me23n for purchase order, i need the table name for invoice tab under that taxes tab is der
    click on it will get the details for excise relates eg N: BED setoff %-8%, N: ECS setoff %-2%...i need this percentage values
    to display ...i tried using j_1..excdtl table but didnt wrkd... so kindly suggest what tables to use...thanx in advance

    HI Prabhu,
    Check the Tables T007A and  T007S
    Check the FM FI_F4_MWSKZ
    If the above doesnt serve your purpose, While taking F4 Help put Debug and proceed every thing is Crystal Clear ( You can see all the FM and Tables in Debug Mode) Thats how i suggested the Above and you too can achieve this.
    Hope this would resolve your Issue
    Cheerz
    Ram

  • Status (Outstanding Invoice) No working for Process Purchase Order(BBP_POC)

    Hi All,
              We have the filter condition outstanding Invoice in the transaction BBP_POC (Process Purchase order) for the field Status....Can any one tell me which indicator is responsiable for this filter......
              i have observed that for the outstanding confirmation is relative to the Final Delivery(No confirmation required) indicator in the purchase order. But the Final invoice indicator is not affecting the filter....
              Is it a standard behaviour or something is missing...?????
    Thanks
    Dibya

    Hi
    <b>Please go through the related pointers below -></b>
    Note 995146 - BBP_POC: Preferred vendor + vendor w/o result when searching
    Note 1104589 PO Search not returning all results
    Note 1086891 BBP_POC search incorrect for user maintained in txn PFCG
    Note 1082123 BBP_POC - saving search criteria fields
    Note 953825 PO (BBP_POC) find get different version of same PO
    Note 860886 Incorrect search results for deleted 'Preferred Vendor'
    Note 1105922 Shopping Cart search in Po item screen-performance
    Note 932291 Archived purchase orders are not displayed
    Note 956108 Empty worklist after clicking button 'Find'
    Note 825662 PO cannot be found by SC number
    <u>Hope this will help. Do let me know.</u>
    Regards
    - Atul

Maybe you are looking for