Simple Abap PO report with Item text

Hello Abap,
Need some help as am more on functional side and our abaper is 2months holiday.
Need to develop simple reports with the following information.
EKKO-EBELEN,
EKKO-WAERS,
EKPO-EBELP
EKPO-TXZ01
EKPO-MENGE
EKPO-NETPR
EKPO-NETWR
ITEM TEXT (TEXT ID-F01) - 100char to be printed.
Tried to developed from scratch but no luck. Need it asap. Thanks in advance.

Hi,
I don't have test data but I think the following code will give you an idea, try to fill in the FM "READ_TEXT" below with your own parameter (check with table STXH).
REPORT ZTEST.
TYPES: BEGIN OF TY_RESULT,
   EBELN TYPE EKKO-EBELN,
   WAERS TYPE EKKO-WAERS,
   EBELP TYPE EKPO-EBELP,
   TXZ01 TYPE EKPO-TXZ01,
   MENGE TYPE EKPO-MENGE,
   NETPR TYPE EKPO-NETPR,
   NETWR TYPE EKPO-NETWR,
   ITEM_TEXT TYPE CHAR100,
   END OF TY_RESULT.
DATA: GT_EKPO TYPE STANDARD TABLE OF EKPO,
       GS_EKPO TYPE EKPO,
       GT_EKKO TYPE STANDARD TABLE OF EKKO,
       GS_EKKO TYPE EKKO,
       GT_RESULT TYPE STANDARD TABLE OF TY_RESULT,
       GS_RESULT TYPE TY_RESULT,
       LV_TAB_IND TYPE SY-TABIX,
       GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
       GS_FIELDCAT TYPE LINE OF SLIS_T_FIELDCAT_ALV,
       GV_NAME TYPE CHAR70,
       GS_TLINE TYPE TLINE,
       GT_TLINE TYPE STANDARD TABLE OF TLINE.
SELECT-OPTIONS: SO_EBELN FOR GS_EKKO-EBELN,
                 SO_WAERS FOR GS_EKKO-WAERS.
START-OF-SELECTION.
   PERFORM SELECTION.
   PERFORM BUILD_FIELDCAT.
   PERFORM DISPLAY.
*&      Form  SELECTION
*       text
FORM SELECTION.
   SELECT EBELN WAERS FROM EKKO INTO CORRESPONDING FIELDS OF TABLE GT_EKKO
     WHERE EBELN IN SO_EBELN
     AND WAERS IN SO_WAERS.
   IF GT_EKKO[] IS NOT INITIAL.
     SELECT EBELN EBELP TXZ01 MENGE NETPR NETWR FROM EKPO INTO CORRESPONDING FIELDS OF TABLE GT_EKPO
       FOR ALL ENTRIES IN GT_EKKO
       WHERE EBELN EQ GT_EKKO-EBELN.
     SORT GT_EKPO BY EBELN.
   ENDIF.
   LOOP AT GT_EKKO INTO GS_EKKO.
     CLEAR GS_RESULT.
     CLEAR LV_TAB_IND.
     MOVE-CORRESPONDING GS_EKKO TO GS_RESULT.
     READ TABLE GT_EKPO TRANSPORTING NO FIELDS WITH KEY EBELN = GS_EKKO-EBELN BINARY SEARCH.
     IF SY-SUBRC EQ 0.
       LV_TAB_IND = SY-TABIX.
       LOOP AT GT_EKPO INTO GS_EKPO FROM LV_TAB_IND.
         IF GS_EKKO-EBELN NE GS_EKPO-EBELN.
           EXIT.
         ENDIF.
         MOVE-CORRESPONDING GS_EKPO TO GS_RESULT.
         CONCATENATE GS_RESULT-EBELN GS_RESULT-EBELP INTO GV_NAME.
         CONDENSE GV_NAME NO-GAPS.
         CALL FUNCTION 'READ_TEXT'
           EXPORTING
             CLIENT         = SY-MANDT
             ID             = 'F01'
             LANGUAGE       = SY-LANGU
             NAME           = GV_NAME
             OBJECT         = 'TEXT'
           TABLES
             LINES          = GT_TLINE
           EXCEPTIONS
             NOT_FOUND      = 1.
         LOOP AT GT_TLINE INTO GS_TLINE.
           IF SY-TABIX EQ 1.
             GS_RESULT-ITEM_TEXT = GS_TLINE-TDLINE.
           ELSE.
             CONCATENATE GS_RESULT-ITEM_TEXT GS_TLINE-TDLINE INTO GS_RESULT-ITEM_TEXT.
           ENDIF.
         ENDLOOP.
         APPEND GS_RESULT TO GT_RESULT.
       ENDLOOP.
     ENDIF.
   ENDLOOP.
ENDFORM.                    "SELECTION
*&      Form  BUILD_FIELDCAT
*       text
FORM BUILD_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  1.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'EBELN'.
   GS_FIELDCAT-SELTEXT_L       =  'Purchasing Document Number'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  2.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'WAERS'.
   GS_FIELDCAT-SELTEXT_L       =  'Currency Key'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  3.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'EBELP'.
   GS_FIELDCAT-SELTEXT_L       =  'Item No'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  4.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'TXZ01'.
   GS_FIELDCAT-SELTEXT_L       =  'Short Text'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  5.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'MENGE'.
   GS_FIELDCAT-SELTEXT_L       =  'Purchase Order Quantity'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  6.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'NETPR'.
   GS_FIELDCAT-SELTEXT_L       =  'Net Price'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  7.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'NETWR'.
   GS_FIELDCAT-SELTEXT_L       =  'Net Order Value'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
   CLEAR GS_FIELDCAT.
   GS_FIELDCAT-COL_POS         =  8.
   GS_FIELDCAT-TABNAME         =  'GT_RESULT'.
   GS_FIELDCAT-FIELDNAME       =  'ITEM_TEXT'.
   GS_FIELDCAT-SELTEXT_L       =  'Item Text'.
   APPEND GS_FIELDCAT TO GT_FIELDCAT.
ENDFORM.                    "BUILD_FIELDCAT
*&      Form  DISPLAY
*       text
FORM DISPLAY.
   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
       I_CALLBACK_PROGRAM      = SY-REPID
       IT_FIELDCAT             = GT_FIELDCAT[]
     TABLES
       T_OUTTAB                = GT_RESULT
     EXCEPTIONS
       PROGRAM_ERROR           = 1
       OTHERS                  = 2.
   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.                    "DISPLAY
Thanks.
Regards,
Keng Haw

Similar Messages

  • NI report with Cyrillic text

    Hi all,
    I need to produce a pdf report with Russian text.
    As you can see in the code, I using the "NIReport_SetTextAttribute"command for transliterate the charset to russian.
    if I set the system language to Russian I can type Russian characters in to pdf, there is no error.
    But when I change the system language ( exp:to English),there is not any characters in to pdf.
    How can I solve this problem?
    Attachments:
    result_pdf.png ‏34 KB
    code.png ‏51 KB

    Hello Basil and Humphrey;
    I will try to explain the problem. Let's go over a CVI example, so you can reproduce it on your own.
    In the NI report example (nirsample.cws) shipped with CVI installation, an attribute called NIR_TEXT_ATTR_FONT_CHARSET is used.
    In one case, it is changed to "NIRConst_CharsetSymbol".
    As a result of this symbol charset setting, if you type "qwerty" as a string in your code, it is displayed as 6 different symbols side-by-side in the resultant PDF report file (we print the file to a PDF printer not on paper).
    This means, the report toolbox gets the character codes representing the letters "q,w,e,r,t,y" and prints corresponding symbols instead whose character codes match those latin letters. To obtain this result, you do not need to change any computer setting (system locale, CVI editor font charset, etc).
    So we thought, if we type some the same "qwerty" string and then select the Russian charset instead of symbol we would see corresponding characters from the Russian alphabet. But that is not the case.
    The only way to print Russian into NI report is to change the system locale (Control panel > Regional Options > Default language for non-unicode programs) to Russian. In that case, we can print Russian characters in the code as strings.
    (we also set the keyboard input language to Russian, but that is not a must, you can type Russian using combinations like ALT + 0215 once the locale is Russian and still get the same result)
    After this locale setting, the created PDF displays Russian characters even if the NIR_TEXT_ATTR_FONT_CHARSET attribute is not NIRConst_CharsetRussian.
    It look like the font charset attribute is not fully implemented. It works for symbol charset but not for Russian.
    So the questions are:
    - Is this expected behaviour?
    - Why symbol charset behaves different then Russian for instance?
    - What is your suggested method for printing Russian text in pdf reports?
    Thank you.
    S. Eren BALCI
    www.aselsan.com.tr

  • Report on PR with item text

    Hi
    I need a list report of PR in which item text(written in long text) of PR (which is genreted through PS) should come
    In which report can i get this?
    Regards
    Kalpesh

    Hi
    The long text (or item text written for material component in PS) will be printed as item text under TEXT tab in PR/PO item details. There is no such report to show the PRs/POs with text option (ME5J/ME5K etc).
    Thanks

  • Report for Item texts in PO

    Hi Gurus,
    Could you please tell  which report (transaction) gives the item text details with respect to PO ??
    regards
    Subbu

    I dont think there is any standard report for the same.  You can however go for an ABAP  development  :
    After entering the item text , save the PO , then go to the PO in display mode and double click on that Text. A new screen will open up for PO text. There in Header Menu select : Goto-> Header . There you will find the text ID and the Text Object which you can pass to tables STXH and STXL and get the texts.
    Raviraj

  • Word report with Cyrillic text

    Hi all,
    I've never used one of these forums before so hope I'm doing right.
    I need to produce a word report with Russian & English text , if I set the system language to Russian I can type Russian characters in to word, but if I have a string constant in labview which I insert into a table in word the text from string constant changes.
    Thanks for any help anyone can give.

    Hi Mike 
    Thanks for the reply.
    The document that I will be working on hasn't been translated yet, so I took the string constant from UM_confirm Exit.vi http://digital.ni.com/public.nsf/allkb/24D845629A22AB6A86257473005ECF35?OpenDocument and wrote a small vi (see attachment) to see if I could put the Russian string constant into a table in word I separated the Russian & English strings and entered them into different cells in a word table. The Russian characters no longer look like Russian characters (see attachment 2). If I set the system language to Russian on the language bar I can Type Russian characters into word.
    Regards
    John B 
    Attachments:
    Russian doc.doc ‏1 KB
    russian report vi.JPG ‏36 KB

  • Getting text ID and Text object  associated with item texts in PO...

    Hi,
    To print standard text on smartform for a given item in purchase order, I need to find the text ID and object associated with it.
    There are various texts like item text, Info record PO text, Material PO Text, Delievry Text, etc...
    Now when I go to ME22N, and select item detail for any item -> Texts , how do I get text ID, and object associated with it ?

    Hi ,
        Use table stxh,stxl
        FM read_text.
        you can view the text id by following
        this link
         me23->header-text-double click on text->menu goto->
         header        
    Regards
    Amole

  • Finding PO number with ITEM text as input

    Hello
    Is there any way/table/fm to list down all the PO that has a particular ITEM text without writing a program .
    For eg , PO 123 , has an ITEM text 'aaaa bbbb cccc dddd' . Now i want to find out all the PO that has this particular text as its ITEM text .
    Thanks
    J

    types: begin of ty_ekpo,
               ebeln type ebeln,
               end of ty_ekpo.
    data: lt_ekpo type table of ty_ekpo.
    Select ebeln into table lt_ekpo where TXZ01 = <<Input your text here>> from table EKPO.
    you will recieve all the POs into this Internal table 'lt_ekpo'.

  • Building a report with a text based on table rows

    Hello!
    I have in my database a table named "Support_Request" and another table named "Request_Advance", the first one have a brief description of each support request problem and some information related, the second one have each participation of technicians and customers in the resolution of the case (i.e a knowledge base about the request)....
    Well, i want to take each advance related to a support_request and concat them in a unique text to show this information in a report, how i do that?....
    acctually iam trying without results with a before report trigger with the following code:
    function BeforeReport return boolean is
         advance_report request_advance.advance%type;
    cursor cur is
    select advance from request_advance
    where id_caso=:id_caso;
    begin
    open cur;
    loop
    fetch cur into advance_report;
    :TOTAL_ADVANCE:=:TOTAL_ADVANCE || advance_report || '********';
    exit when cur%NOTFOUND;
    end loop;
    return (TRUE);
    end;
    please can somebody help me? :$

    Thanks Claudine, i do the following function (spanish version) and works:
    CREATE OR REPLACE FUNCTION Avance_Total(caso IN soportebwv2.avance_caso.id_caso%type) RETURN VARCHAR2
    IS
         avance_total VARCHAR2(15000);
         avance_reporte soportebwv2.avance_caso.avance%TYPE;
         CURSOR cur IS
         SELECT avance FROM avance_caso
         WHERE id_caso=caso;     
    BEGIN
         OPEN cur;
    LOOP
         FETCH cur INTO avance_reporte;
         avance_total:= avance_total || avance_reporte || '*************************************';
         EXIT WHEN cur%NOTFOUND;
    END LOOP;
    CLOSE cur;
    RETURN avance_total;
    END;
    SHOW ERRORS;
    but my advance appear repeating several times, you have any idea why?
    Beatriz

  • Shift Report with Long Text

    how do i  get a shift report out of the PLM (plant maintenance) module that includes the following:
    Work Order Number
    Person Responsible
    Time and date
    Equipment
    Hours Confirmed
    Goods Movement
    Long Text Description of what was done to correct the problem.
    IW40 displays all the necessary fields that we are looking for with the exception of the long text description.
    Thank you
    Nikhil

    Hi ,
          I found an enhacement spot ES_RIAUFK10  - ECC6.0 ,EHP3 ,SE18 for IW40 programme , check the possibility to add a field via this one ..
    For longtext u need to read from STXH Table using FM READ_TEXT
    regrds
    pushpa

  • Can I define simple Developer 6i reports with XML?

    Hi,
    this may sound far fetched, but can I define report definitions
    in XML and convert it to RDF?
    My RDFs would have simple layout - one record of a table on of
    page, in form layout. It would be much easier - and this way I
    could redefine it any time - than to user the report wizard in
    Developer 6i.
    TIA,
    Tamas Szecsy

    Yes you can. You should look up the STYPE parameter of
    rwcon60.exe which one of its possible values is XML and as your
    DTYPE use the PDF. The report builders help has covered the
    details on this.
    Good luck,
    --PAYAM
    Hi,
    this may sound far fetched, but can I define report definitions
    in XML and convert it to RDF?
    My RDFs would have simple layout - one record of a table on of
    page, in form layout. It would be much easier - and this way I
    could redefine it any time - than to user the report wizard in
    Developer 6i.
    TIA,
    Tamas Szecsy

  • Need simple ABAP OO reports, BAPI's and BDC upload using flat file.

    Hello experts,
    I am currently practicing ABAP and I would like to request some example codes for ABAP Objects, BAPIs, BDC's, etc.
    Thanks!

    hi viray,
    check these...
    BAPI'S..
    http://help.sap.com/saphelp_47x200/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/3e/ecf226942511d2ad4b080009b0fb56/frameset.htm
    http://www.sapgenie.com/abap/bapi/index.htm
    Abap Objects
    http://www.sapgenie.com/abap/OO/index.htm
    http://sap.ittoolbox.com/documents/industry-articles/introducing-abap-objects-982
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    bdc's...
    http://www.sappoint.com/abap/bdcconcept.pdf
    http://wiki.ittoolbox.com/index.php/Topic:ABAP_-_BDC
    http://www.sap-img.com/bdc.htm
    hope these help,
    do reward if it helps,
    priya.
    Message was edited by: Priya

  • Crystal Report with text(csv) data file, can we set it as input parameter?

    Hi,
    I am a new user of Crystal Reports 2008.
    I have created a report with charts in it. The input data comes from a csv text file.
    Can I set the name of this text file as an input parameter?
    as I need to generate 44 similar reports with different text filenames(and data)?
    Thank you.
    Regards

    Brian,
    Thanks much.
    I did exactly what you said.
    Just to see any change, I first gave a bad report file name just to see if I am accidentally pointing to a different file,
    but I got an error saying report not found.
    Then I renamed my original datafile name and generated a report and it still generated one without giving an error.
    Then I also gave a junk name to the logoninfo and printed that name, the new name was assigned to logoninfo, but the code did not error out.
    It ended up generating the report.
    Now here is what I think is happening,
    1) The save data in report option seems to be still on even though I have turned it off in 2 locations
    a) file -> Report Options
    b) file -> Options -> Reporting tab.
    2) For some reason the logoninfo is getting ignored as well.
    Since I did not see any answers yesterday I posted a link to this thread on the .Net forum
    Crystal Report with text(csv) data file, can we set it as input param? C#
    and Ludek Uher says that I am connecting to the text file via a DAO database engine and so need to use the same code for changing the text file as for changing an Access database.
    But the link he gave me tells me to try the same thing that we have been trying..
    Here is my plan,
    1) I will first try and find out why my save data with report option is still on ( but it shows off in Crystal ).
    2) why is LogonInfo getting ignored.
    Meanwhile any suggestions from anyone are welcome.

  • Item text is not getting updated in Payment document generated through F110

    Hi all,
    After generating the payment document via Transaction Code u2013 F110, system is not updating the Text field in the payment document with the text that we have entered in the Invoice (MIRO or FI Invoice).
    While processing the document via transaction code u2013 F110, in the layout shown for the Invoices to be considered for payment (screen of u201CEdit Proposalu201D), text is not getting updated. When we pressed F1 at the Text field (Which is blank) we came to know that it is a u201CItem Textu201D with u201CTable u2013 REGUEu201D /  u201CField u2013 SGTXTu201D.
    In BSEG (SGTXT field) as well as BSIK (SGTXT field) we are getting the Invoice document with the text maintained in it via MIRO or FI invoice.
    But while processing the invoices through Tcode - F110, in the layout of Edit Proposal (Table - REGUE / Field - SGTXT) we are not getting the u201CText fieldu201D but getting the other data such as Doc. No.( Table - REGUE / Field - BELNR), Fiscal Year (Table - REGUE / Field - GJAHR) etc for processing the proposal which is getting shown in BSEG as well as BSIK.
    In case of manual payment (F-53) we can input the text manually hence that will get updated in payment document but this thing is not possible with F110.
    Can anybody guide me on getting the ItemText (Not Doc. Header text) in FI payment document after F110 execution?
    Regards,
    Shridhar

    Hi Suresh,
    Thanks for the prompt reply. We will be obliged if you guide us in that respect since F110 is a Std. SAP code.
    Have you refer OSS before arriving at the conclusion of developing ABAP program since the Item Text is a std. field of Std. Tcode - F110. Same should had been get updated while making the payment in reference to the Invoice which haves item text in it ?
    Regards
    Shridhar
    FICO

  • ABAP list report, multiple selections - select-options

    I have written a very simple ABAP list report, that contains a single select-option.  On the selection screen, I have the option of entering multiple values, with each new value being displayed directly underneath the old, but I am only getting the first value entered on the screen displayed.  Does anyone have any sample code for me?

    Hi Daniel,
    Select_Options consists of 4 parameters, in with the range consists in eg...
    Select-options s_vbeln for vbak-vbeln.
    then s_vbeln-low, s_vbeln-high are the range values...
    So whne you write select query.
    write vbeln in s_vbeln
    instead of vbeln eq s_vbeln
    Hope this solves your problem.
    Thanks & Regards,
    Dileep .C

  • How to compare Item Text in Purchase Order

    God day Gurus,
    I have a scenario where in I have to compare the saved Item Text to the current edited one in Purchase Oder. I used READ_TEXT function but it only get the saved item text in the document. Is there a way to compare the original and edited item text in P.O.? Here is my sample, I have PO 000001 with Item Text "Sample" and saved it. Then I edited the PO and change the Item text from "Sample" to "Testing". When I use READ_TEXT function, I will get the text "Sample". How will I get the text "Testing" during saving of PO?
    Thanks in advance.

    Hello
    In case you are working already on ERP 6.0 you should have a look at BAdI ME_PROCESS_PO_CUST, interface methods CHECK or CLOSE depending on your requirements.
    Regards
    Uwe

Maybe you are looking for

  • Re: Sun Fire v490 / Solaris 9 booting from CD, Network problems

    Hi Folks, Apologies in advance for the length of this post. For the purposes of disaster recovery I have built a custom CD based on the Solaris 9 installation disk with our third party backup / restore software included on it. After the rcS script ha

  • Save Labview Class to file?

    Hi there, I am playing around with the new Labview classes and i am thinking working with classes is pretty cool. But i am not able to save the objekt to a binary file load them and use this data to initialize the Object with this data. Its no proble

  • Acrobat-X

    I recently deleted Acrobat-7 and replaced it with Acrobat-X and just about everything has gone wrong.  I even had problems with Safari!  Safari would no longer display or download PDF files.  Little by little I've been fixing the problems but it's be

  • Installing Windows in Boot Camp - ISO image?!

    Hi all, So I've got some Sage accounting software which only works with Windows....I've downloaded Boot Camp and it's asking for the ISO image - what the **** is this?!  I haven't yet bought Windows, I don't want to pay for it until I know I'm buying

  • Importing 3rd party plug-ins into CS5

    Coming from CS3, I've tried drag and drop but no joy.  How do I get my plug-ins/filters moved over - or do I have to continue to use CS3 if I want to use them??? It's been some time and I'm not sure I even have the original installers or not - it wou