HOW TO EXTRACT THE PO CONDITIONS

HI,
i am using the following code,but in this i am not geting the po conditions values,is there any way to get the condition values into excel sheet.
report ztest1.
TABLES: EKKO.
*PARAMETERS : P_EBELN TYPE EBELN.
SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN OBLIGATORY.
TYPES: BEGIN OF T_PO,
         EBELN TYPE EBELN,
       END OF T_PO.
DATA: IT_PO TYPE STANDARD TABLE OF T_PO,
      WA_PO TYPE T_PO.
DATA : IT_ITEMS TYPE TABLE OF BAPIEKPO WITH HEADER LINE.
DATA: PO_ITEMS_SHEDULE TYPE TABLE OF BAPIEKET WITH HEADER LINE.
DATA: PO_ITEM_TEXT TYPE TABLE OF BAPIEKPOTX WITH HEADER LINE.
DATA: PO_ITEM_ACCOUNT_ASSIGNMENT TYPE TABLE OF BAPIEKKN
WITH HEADER LINE.
DATA: PO_HEADER_TEXTS TYPE TABLE OF BAPIEKKOTX WITH HEADER LINE.
DATA: PO_HEADER TYPE BAPIEKKOL.
DATA: RETURN1 TYPE TABLE OF BAPIRETURN WITH HEADER LINE.
DATA: RC TYPE I.
SELECT EBELN INTO TABLE IT_PO FROM EKKO WHERE EBELN IN S_EBELN.
PERFORM FILE_DELETE.
LOOP AT IT_PO INTO WA_PO.
  CLEAR: PO_HEADER_TEXTS[], IT_ITEMS[], PO_ITEM_ACCOUNT_ASSIGNMENT[],
         PO_ITEMS_SHEDULE[], PO_ITEM_TEXT[], RETURN1[].
  CALL FUNCTION 'BAPI_PO_GETDETAIL'
    EXPORTING
      PURCHASEORDER              = WA_PO-EBELN
      ITEMS                      = 'X'
      ACCOUNT_ASSIGNMENT         = 'X'
      SCHEDULES                  = ' '
      HISTORY                    = 'X'
      ITEM_TEXTS                 = 'X'
      HEADER_TEXTS               = 'X'
    TABLES
      PO_HEADER_TEXTS            = PO_HEADER_TEXTS
      PO_ITEMS                   = IT_ITEMS
      PO_ITEM_ACCOUNT_ASSIGNMENT = PO_ITEM_ACCOUNT_ASSIGNMENT
      PO_ITEM_SCHEDULES          = PO_ITEMS_SHEDULE
      PO_ITEM_TEXTS              = PO_ITEM_TEXT
      RETURN                     = RETURN1.
  PERFORM DOWNLOAD_DATA: TABLES PO_HEADER_TEXTS USING 'BAPIEKKOTX',
                         TABLES IT_ITEMS USING 'BAPIEKPO',
                         TABLES PO_ITEM_ACCOUNT_ASSIGNMENT USING
'BAPIEKKN',
                         TABLES PO_ITEMS_SHEDULE USING 'BAPIEKET',
                         TABLES PO_ITEM_TEXT USING 'BAPIEKPOTX'.
ENDLOOP.
*&      Form  DOWNLOAD_DATA
FORM DOWNLOAD_DATA  TABLES   IT_TAB
                    USING    STRUC_NAME.
  DATA: IT_DD03P TYPE TABLE OF DD03P WITH HEADER LINE,
        IT_DD03P1 TYPE TABLE OF DD03P WITH HEADER LINE.
  DATA: IT_HEAD TYPE TABLE OF STRING,
        WA_HEAD TYPE STRING.
  DATA: L_TAB(1) TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
  IF NOT IT_TAB[] IS INITIAL.
    CALL FUNCTION 'DD_GET_DD03P_ALL'
      EXPORTING
        TABNAME       = STRUC_NAME
      TABLES
        A_DD03P_TAB   = IT_DD03P
        N_DD03P_TAB   = IT_DD03P1
      EXCEPTIONS
        ILLEGAL_VALUE = 1
        OTHERS        = 2.
    IF SY-SUBRC EQ 0.
      LOOP AT IT_DD03P.
        IF SY-TABIX EQ 1.
          MOVE IT_DD03P-DDTEXT TO WA_HEAD.
        ELSE.
    CONCATENATE WA_HEAD IT_DD03P-DDTEXT INTO WA_HEAD SEPARATED BY L_TAB.
        ENDIF.
      ENDLOOP.
      APPEND WA_HEAD TO IT_HEAD.
    ENDIF.
  ENDIF.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                = 'C:\poextract.xls'
      APPEND                  = 'X'
      WRITE_FIELD_SEPARATOR   = 'X'
    TABLES
      DATA_TAB                = IT_HEAD
     FIELDNAMES              = IT_HEAD
    EXCEPTIONS
      FILE_WRITE_ERROR        = 1
      NO_BATCH                = 2
      GUI_REFUSE_FILETRANSFER = 3
      INVALID_TYPE            = 4
      NO_AUTHORITY            = 5
      UNKNOWN_ERROR           = 6
      HEADER_NOT_ALLOWED      = 7
      SEPARATOR_NOT_ALLOWED   = 8
      FILESIZE_NOT_ALLOWED    = 9
      HEADER_TOO_LONG         = 10
      DP_ERROR_CREATE         = 11
      DP_ERROR_SEND           = 12
      DP_ERROR_WRITE          = 13
      UNKNOWN_DP_ERROR        = 14
      ACCESS_DENIED           = 15
      DP_OUT_OF_MEMORY        = 16
      DISK_FULL               = 17
      DP_TIMEOUT              = 18
      FILE_NOT_FOUND          = 19
      DATAPROVIDER_EXCEPTION  = 20
      CONTROL_FLUSH_ERROR     = 21
      OTHERS                  = 22.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                = 'C:\poextract.xls'
      APPEND                  = 'X'
      WRITE_FIELD_SEPARATOR   = 'X'
    TABLES
      DATA_TAB                = IT_TAB
     FIELDNAMES              = IT_HEAD
    EXCEPTIONS
      FILE_WRITE_ERROR        = 1
      NO_BATCH                = 2
      GUI_REFUSE_FILETRANSFER = 3
      INVALID_TYPE            = 4
      NO_AUTHORITY            = 5
      UNKNOWN_ERROR           = 6
      HEADER_NOT_ALLOWED      = 7
      SEPARATOR_NOT_ALLOWED   = 8
      FILESIZE_NOT_ALLOWED    = 9
      HEADER_TOO_LONG         = 10
      DP_ERROR_CREATE         = 11
      DP_ERROR_SEND           = 12
      DP_ERROR_WRITE          = 13
      UNKNOWN_DP_ERROR        = 14
      ACCESS_DENIED           = 15
      DP_OUT_OF_MEMORY        = 16
      DISK_FULL               = 17
      DP_TIMEOUT              = 18
      FILE_NOT_FOUND          = 19
      DATAPROVIDER_EXCEPTION  = 20
      CONTROL_FLUSH_ERROR     = 21
      OTHERS                  = 22.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " DOWNLOAD_DATA
*&      Form  FILE_DELETE
FORM FILE_DELETE .
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
    EXPORTING
      FILENAME             = 'C:\poextract.xls'
    CHANGING
      RC                   = RC
    EXCEPTIONS
      FILE_DELETE_FAILED   = 1
      CNTL_ERROR           = 2
      ERROR_NO_GUI         = 3
      FILE_NOT_FOUND       = 4
      ACCESS_DENIED        = 5
      UNKNOWN_ERROR        = 6
      NOT_SUPPORTED_BY_GUI = 7
      WRONG_PARAMETER      = 8
      OTHERS               = 9.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " FILE_DELETE

HI Ram
Am not able to access SAP now, I guess FM: 'BAPI_PO_GETDETAIL' itself can return PO conditions as well. Please check the same.
Kind Regards
Eswar

Similar Messages

  • How to extract the column width in ALv report if its executed in background

    I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
    I have executed in background and checked the spool and  for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALV

    Hi Deepthi,
    you can try with the above mentioned suggestions ,if its worked its fine ,
    If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
    or you can use docking container alone for both operations.
    Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
    IF CCON IS INITIAL. (ccon is container name )
    *Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    *Run in foreground
          CREATE OBJECT CCON
            EXPORTING
              CONTAINER_NAME = 'CON1'.
        CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = parent_1.
    ELSE.
    *Run in background
          CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = G_DOCK1.
        ENDIF.
      ENDIF.
    B&R,
    Saravana.S

  • How to Maintain the Pricing Condition Records in CRM

    Hi
    I am new to the CRM
    How to maintain the pricing condition records in crm for the particular condition type?
    as we do in SD(VK11)
    Thanks

    Hi Binu,
    First of all, you could maintain pricing conditions in the following places:
    1. In General Condition Maintenance (GCM)
    2. At the product maintenance level
    3. At the 'Price agreement' tab of Contracts
    4. As manual conditions during order processing at item level
    Now, if you want to maintain conditions using GCM, you first have to maintain a condition maintenance group in the customizing where in you can assign condition table and condition type for different counter values. I am assuming that you have done this activity successfully.
    When you run the transaction '/SAPCND/GCM', for application 'CRM', your condition maintenance group name and context 'GCM', you will be initially taken to a screen where in you'll have an item area which would be blank and then condition fields would be displayed in a tree on the left.
    Here, select the field 'Condition type' and click on icon 'Select records'. You would get a dialog prompting you to enter condition type. Here you can specifiy the condition type for which you want to maintain/view condition records.
    If no condition records are available, item area would be left blank. Here, you can choose a condition type using the standard F4 help. Depending on condition types that are assigned to condition maintenance group, different condition types would be displayed in the F4-help using which you can maintain condition records.
    Hope this helps.
    Regards,
    Pavithra
    **PS: Please reward points if this helps.

  • How to extract the historical data from R/3

    hi
    I am extracting data from R/3 through LO Extraction. client asked me to enhance the data source by adding field. i have enhanced the field and wrote exit to populate the data for that field.
    how to extract the historical data into BI for the enhanced field. already delta load is running in BI.
    regards

    Hi Satish,
    As per SAP Standard also the best way is to delete whole data from the cube and then load the data from set up tables as you have enhanced the data source.
    After data source enhancement it is supported to load normally because you don't get any historical data for that field.
    Best way is to take down time from the users, normally we do in weekends/non-business hours.
    Then fill the set-up tables; if the data is of huge volume you can adopt parallel mechanism like:
    1. Load set-up tables by yearly basis as a background job.
    2. Load set-up tables by yearly basis with posting periods from jan 1st to 31st dec of any year basis as a background job.
    This can make your self easier and faster for load of set-up tables. After filling up set-up tables. You can unlock all users as there is no worries of postings.
    Then after you can load all the data into BI first into PSA and then into Cube.
    Regards,
    Ravi Kanth.

  • How to Extract the data from R/3 Genric extractor to BW ?

    How to Extract the data from R/3 Genric extractor to BW ?

    hi,
    step by step procedure for generic extraction delta
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Refer:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Extractions in BI
    https://www.sdn.sap.com/irj/sdn/wiki
    New to Materials Management / Warehouse Management?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1b439590-0201-0010-ea8e-cba686f21f06
    Ramesh

  • How to find the start condition of a ABAP program?

    Hello Gurus!,
    Could any one please explain how to find the start condition of a ABAP program?
    like its a event based or time based?and also how to find that event and time..
    Thanks in Advance...
    Dinakar

    Hi Dinkar,
    Go to Job Schedule, put Job Step parameter as your program and see scheduled Job.
    In Schedule Job double click to see start condition. and steps to see details and variant.
    Hope it helps.
    Thanks
    CK

  • How to Extract the Highlight Text in PDF File

    Hi Scripters,
    i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
    regards
    baby

    Hi,
    Okay i'll try do best.
    thanks for your reply.
    Regards
    Baby

  • How to extract the content of a mail message?

    Friends,,,
    How to extract the content of a mail message?
    the message does not contain any attachments or images.
    its just a plain text..
    if i use message.getContent(), in addition of the content it returns headers information also...
    but i need only the content of that message...
    if i write code like this:
    String content = (String) message.getContent();
    it gives cast exception...
    if the message contains only plain text, no multipart, then which method is useful to extract only the content?
    please tell me friends..
    thanks in advannce,
    regards,
    Venkata Naveen

    Message.getContent() does not return headers for a simple text/plain
    message. If you're getting headers, something else is wrong.
    Also, casting the result to String should work.
    Most likely the message really isn't a simple text/plain message.
    Provide more details and we'll help you figure out what you're
    doing wrong.
    Also, please read the msgshow.java demo program included with JavaMail.

  • How to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    how to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    Let's say you have a zipped audio collection (audio.zip) containing mp3 files. And you are at a Terminal prompt.
    List the files in the zip archive
    unzip -l audio.zip (that is ell)
    Extract all mp3 audio files into a new home directory folder called mymusic
    unzip -d ~/mymusic audio.zip \*.mp3
    Variations of the above will depend the zip contents, and internal structure. If the zipped audio collection was gzipped, or someone used rar on it, then the extraction process will be different.

  • How to extract the senders IP address of an email?

    How to extract the senders IP adress of an email using applescript ??

    Maybe this will help.
    Extract email addresses from email header - Sender (From) - Mail

  • How to extract the signal out from the waveform by my designated power level?

    Dear all,
         How can  I extract the signal from the waveform accroding to the power level? I read the Trigger&Gate.vi, but this vi extract signal according to the duration time. I want to extract signal according to power level.
         As shown in the following figures, the signal I want to process is between 130000 to 140000, if I zoom in, I can see the the useful signal is between 135400 to 138200. The question is how to extract the signal in the zone?  
        I tried the sub_NoiseEst_And_Chop_Shell.vi in the Packet_based_link example too, but this subvi seemed to be a little slow. Can anybody give me better advice? Thanks in advance!
    Solved!
    Go to Solution.

    I was working on something similar but haven't had time to fully develop it.
    My idea was to use an envelope detector (low pass filter) and then use an energy detection VI on the envelope.
    Here's where I left off
    Anthony F.
    Product Marketing Engineer
    National Instruments
    Attachments:
    test.vi ‏331 KB

  • How to extract the date value of IBOR date="12/12/2009"

    I have the following query, but do not get the date value out:
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS ibor_date VARCHAR2(20) PATH '/IBOR/date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;
    How to extract the date value of <IBOR date="12/12/2009">?

    Hi,
    The date is an attribute of element IBOR. So you must use "@date" in the xpath expression :
    WITH ibors AS (
    SELECT xmltype('<?xml version="1.0" encoding="utf-8"?>
    <IBOR date="12/12/2009">
    <LIBOR currency="USD">
    <OneYear>1.38875</OneYear>
    </LIBOR>
    </IBOR>
    ') ibor_xml
    FROM dual
    SELECT i.ibor_date, i.ibor_oneyear
    FROM ibors,
    XMLTABLE(
    '//IBOR'
    PASSING ibors.ibor_xml
    COLUMNS
    ibor_date VARCHAR2(20) PATH '/IBOR/@date',
    ibor_oneyear VARCHAR2(20) PATH '/IBOR/LIBOR/OneYear'
    ) i;

  • How to extract the Fast Formula Body through database?

    Hi All
    The Oracle fast formulas are stored in the ff_formulas_f table under the column formula_text having the datatype long. I want to extract the formula text through back end. When I use the statement, Select formula_text from ff_formulas_f, I am getting only the first line.
    How to extract the full formula text?
    Regards
    Rahman

    Here's a unix shell script to do it for you based on the info given by the other posters.
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 100000
    column formula_text format a512;
    select formula_text from ff_formulas_f where formula_name = '$ffname';
    exit;
    END
    Also this will list the formula names given a substring:
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 5000
    select formula_name from ff_formulas_f where formula_name like '%$ffname%';
    exit;
    END

  • How to extract the smtp response code

    Hi,
    I am trying to get the server response by SMTPTransport.getLastServerResponse(),
    and getting the response as "250 2.0.0 OK 1201842889 c39sm4983397anc.25", in case of success.
    This response would differ in case of failure.
    Could please guide me as how to extract the response code from the result.
    Thanks!!

    It's time to read the SMTP spec.
    Also, read the javadocs for the com.sun.mail.smtp
    package to see how to get an Exception even for
    success that includes the detailed response codes.
    The smtpsend.java demo program will show you how
    to interpret the exception.

  • How to extract the xcontrol output

    I created one xcontrol for pressure sensors . I am able to display the output correctly but i could not able to use the output for other inputs .
    how to extract the xcontrol output
    for clear understanding please see the attached vi testing .
    Attachments:
    testing.vi ‏9 KB
    Pressure sensors.zip ‏96 KB
    testing.vi ‏9 KB

    I always measure velocity in furlongs per fortnight 
    Units are very powerful, and like any great magic, can result in serious unintended circumstances.
    I've tried them a couple of times and decided they were more difficult to use than the value provided. Maybe it's better now, but I'm still on LV 8.6
    http://forums.ni.com/t5/LabVIEW/Why-do-very-few-programmers-use-LabVIEW-unit-labels/td-p/1119746
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

Maybe you are looking for

  • Error during MIGO-Error during maint. of delivery costs in master condition

    Hi We are getting error as below during MIGO against a PO with doc type NB: "Error during maint. of delivery costs in master conditions, Delivery cost conditions in different validity periods not identical" What might be cause?? Thanks Maruthi

  • Intel kms resolution problem in tty [solved]

    Hello guys, I had always added vga=773 to kernel line to have a acceptable resolution on startup and in tty. This was a relict of my time without KMS. For testing purposes I deleted it and tried without it but the system fills then just only about on

  • Outbound file interface - Header and item record transfer issue

    Hi. Pls help me complete this work by today: I have to pass header and item record into file in application server. I am retrieving Header record from table MCHB & RESB and item record from MKOL & LFA1 I have to create separate file per plant ( plant

  • Lightroom 5 changes crop history

    so I keep having a problem where I crop inlightroom, get a photo all set, move on to the next one and then come back and it automatically reverts back to the crop before the final, so I have to go back one stop in the history to where I actually left

  • Reformatted laptop and now I can't change iPhone media

    I recently reformatted my laptop and now when I connect my iPhone to my laptop, I'm unable to change music and apps without erasing the previous data on my phone. What can I do to have full access to my iPhone again?