Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting multiple PO Line item Text

Former Member
0 Likes
6,620

hi ,

i am working on one smartforms development.

this is my first development, almost i completed, but the problem is i need to print PO line item text.

through READ_TEXT i am getting text also, but its displaying only last item text in print out.

E.g., 5 line item is there with text means, i am getting only 5th item text repeatedly.

how to solve this , help me.

regards,

S.Kavitha

1 ACCEPTED SOLUTION
Read only

thangam_perumal
Contributor
0 Likes
5,702

Hi Kavitha,

              Yeah you have to pass the Internal table value to Loop node.

for your reference

CALL FUNCTION 'READ_TEXT'

   EXPORTING

    CLIENT                        = SY-MANDT

     id                            = 'F01'

     language                      'E'

     NAME                          = name

     OBJECT                        'EKPO'

   TABLES

     lines                         td_lines.

           .



after did this if  facing the issue mean. Please check it out in debug mode.



Regards,

Thangam.P

hi ,

i am working on one smartforms development.

this is my first development, almost i completed, but the problem is i need to print PO line item text.

through READ_TEXT i am getting text also, but its displaying only last item text in print out.

E.g., 5 line item is there with text means, i am getting only 5th item text repeatedly.

how to solve this , help me.

regards,

S.Kavitha

17 REPLIES 17
Read only

Former Member
0 Likes
5,702

Hi Kavitha,

When you called read_text function module then you will get data in internal table it_lines right.

so create loop node and add the it_lines in loop node. create text element under loop node.

add wa_lines-text in text element.

thanks,

Sree

Read only

Former Member
0 Likes
5,702

Hi Kavitha,

   I think your are not looping the internal table which holds the data fetched from the Function module READ_TEXT.

Regards

Ekalavya

Read only

0 Likes
5,702

Hi Kavitha,

You need to appen your text in an internal table. after that pass that in smartform.

regrds

bipin

Read only

thangam_perumal
Contributor
0 Likes
5,703

Hi Kavitha,

              Yeah you have to pass the Internal table value to Loop node.

for your reference

CALL FUNCTION 'READ_TEXT'

   EXPORTING

    CLIENT                        = SY-MANDT

     id                            = 'F01'

     language                      'E'

     NAME                          = name

     OBJECT                        'EKPO'

   TABLES

     lines                         td_lines.

           .



after did this if  facing the issue mean. Please check it out in debug mode.



Regards,

Thangam.P

Read only

0 Likes
5,702

hi all,

i passed that to loop only, but in my smartform i need to print data like,

1st line po line item detail like po.no, item.no, uom, ....etc.

2nd line i need to print that item text.

3rd line asset detils.

1st and 3rd line all data's i am getting from this loop gt_ekpo into gw_ekpo.

then, inside that if i give it_line-text (item text field) means it is not showing.

how i will print that one

in this screen shot, po_item loop is like  gt_ekpo into gw_ekpo.

Read only

0 Likes
5,702

Hi Kavitha,

Inside your loop on PO_ITEMS, create program lines and insert the code as below.

Refresh: td_lines.

clear v_name.

concatenate gw_ekpo-ebeln gw_ekpo-ebelp into v_name.

CALL FUNCTION 'READ_TEXT'

   EXPORTING

    CLIENT                        = SY-MANDT

     id                                 = 'F01'

     language                     'E'

     NAME                          = v_name

     OBJECT                       'EKPO'

   TABLES

     lines                         =  it_td_lines.

This internal table IT_TD_LINES will hold all the lines of your item text.

Now create anothe loop inside your loop on PO_ITEMS. This loop should be looping on IT_TD_LINES into WA_LINES.

Create a text in this loop with &WA_LINES-TDLINE&.

Hope this helps,

N. George.

Read only

0 Likes
5,702

Hi Kavitha,

1. First create the table under the main window.
2. give some origins to each column
3. in header, maintain all column headers
4. in main area, display all po line details.
5. in table data tab, will get like loop, so here enter it_poitems to wa_poitems
6. wherever you want to display the line item text, create loop node to display the item text.
7. atlast display 3rd line item details.

Thanks,

sree

Read only

VenkatRamesh_V
Active Contributor
0 Likes
5,702

Hi Kavitha,

Try.

Create Program lines,

pass the values to the FM READ_TEXT.

get the text values to the variables by adding loop and endloop inside the program lines.

Regards,

Venkat.

Read only

0 Likes
5,702

hi george sir,

same problem now for PR line item text.

Actullay, i have created one output ztable. And i am moving output field's data to that table.

in loop at gi_eban into gs_eban, inside that loop i called read_text function module to read item text and moving that to same output ztable .

if pr line item having text means , all the data like line item data with text is coming , else if line item does not have text means other line item data also not coming in the print out.

in smartform under main window i created one table in that main area i gave the fields for display.

now i want it like , if text exist for the particular line item means it will print the details, otherwise if text not exist for particular line item means otherthan text remaining things has to come in that print out.

how can i do this, pls help me

regards,

s.kavitha

Read only

0 Likes
5,702

Hi Kavitha,

I did not understand your problem clearly.

In the main area, you have created an internal table in which you are looping GI_EBAN into GS_EBAN?

For what do you have a ZTABLE?

Read only

0 Likes
5,702

hi sir,

in smartform under main window , i have created table in that data tab i declared gt_final into gw_final

gt_final is a ztable having all the output data.before printing i am getting data from all relavent table and move all into this ztable.

so, i declared this gt_final in smartform table data tab. but now the problem is if for particular line item having text means , it displaying all the data with text,

else if text only not their for particular line item means, it not displaying all the data.

but i need, if text not their means , it has to disply the remaining data .

Read only

0 Likes
5,702

Could you check if your append statement into GT_FINAL is dependent on your READ_TEXT FM contents in any way?

Read only

0 Likes
5,702

hi sir,

i dont know how to check, i will post the loop coding .

can u pls explain me.

loop at gi_eban into gs_eban.

g_sum = ( gs_eban-menge * gs_eban-preis ).

g_total = ( g_total + g_sum ).

move-corresponding gs_eban to gs_final.

read table gi_t024 into gs_t024 with key ekgrp = gs_eban-ekgrp.

move-corresponding gs_t024 to gs_final.

read table gi_t001k into gs_t001k with key bwkey = gs_eban-werks.

move-corresponding gs_t001k to gs_final.

read table gi_t001 into gs_t001 with key bukrs = gs_t001k-bukrs.

move-corresponding gs_t001 to gs_final.

read table gi_t001w into gs_t001w with key werks = gs_eban-werks.

move-corresponding gs_t001w to gs_final.

read table gi_adrc into gs_adrc with key addrnumber = gs_t001w-adrnr.

move-corresponding gs_adrc to gs_final.

read table gi_user_addr into gs_user_addr with key bname = gs_eban-ernam.

move-corresponding gs_user_addr to gs_final.

read table gi_ebkn into gs_ebkn with key banfn = gs_eban-banfn.

move gs_ebkn-ps_psp_pnr to gs_final-ps_psp_pnr.

read table gi_prps into gs_prps with key pspnr = gs_ebkn-ps_psp_pnr.

move-corresponding gs_prps to gs_final.

read table gi_anla into gs_anla with key posnr = gs_prps-pspnr.

move-corresponding gs_anla to gs_final.

CONCATENATE gs_EBAN-banfn gs_EBAN-bnfpo INTO lv.

*lv = gs_stxl-tdname.

CLEAR gi_text.

CALL FUNCTION 'READ_TEXT'

  EXPORTING

   CLIENT                        = SY-MANDT

    ID                            = 'B01'

    LANGUAGE                      = 'E'

    NAME                          = lv

    OBJECT                        = 'EBAN'

  TABLES

    LINES                         = gi_text

EXCEPTIONS

   ID                            = 1

   LANGUAGE                      = 2

   NAME                          = 3

   NOT_FOUND                     = 4

   OBJECT                        = 5

   REFERENCE_CHECK               = 6

   WRONG_ACCESS_TO_ARCHIVE       = 7

   OTHERS                        = 8

          .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*CLEAR gv_text01.

LOOP AT gi_text INTO gs_text.

    MOVE GS_TEXT-TDLINE TO GS_FINAL-Z_TEXT01.

  CLEAR lv_text.

append gs_final to gi_final.

clear: gs_final.

ENDLOOP.

endloop.

regards,

S.Kavitha

Read only

0 Likes
5,702

This is the error piece of code. Move the append statement after the 1st endloop.

Change as below.

LOOP AT gi_text INTO gs_text.

    MOVE GS_TEXT-TDLINE TO GS_FINAL-Z_TEXT01.

  CLEAR lv_text.

  

ENDLOOP.

append gs_final to gi_final.

clear: gs_final.

endloop.

Read only

0 Likes
5,702

hi sir,

if i give like,what u mentioned above with out text is coming .

but if text is exist, that text is not coming in the output.

whether i have to give read statement instead of loop at gi_text.?

regards,

S.kavitha

Read only

0 Likes
5,702

Hi,

You can do

Read table GI_TEXT into GS_TEXT index 1.

if sy-subrc is initial

GS_FINAL-Z_TEXT01 = GS_TEXT-TDLINE.

Endif.

This will give the first line of the item text in your final internal table.

Else if you need all lines, you need to create a loop in your main area internal table.

Read only

0 Likes
5,702

HI SIR,

MY PROBLEM IS SOLVED , THANK U .

REGARDS,

s.kAVITHA