Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2878

Re: Insert entries in ABAP QUERY

$
0
0

now, I think it is easy to call FM and get the text. So could you please try this code,

may it help you,

 

 


REPORT zibo_pg_test99.

TYPES: BEGIN OF ty_vbrp.
       
INCLUDE STRUCTURE vbrp.
TYPES: item_txt TYPE wcf_ust_description,
END OF ty_vbrp.

DATA lt_vbrp TYPE TABLE OF ty_vbrp.

DATA lv_name TYPE tdobname.
DATA lt_item_txt TYPE TABLE OF tline.
DATA ls_item_txt TYPE tline.

FIELD-SYMBOLS <ls_vbrp> TYPE ty_vbrp.

DATA lr_alv TYPE REF TO cl_salv_table.

START-OF-SELECTION.

 
SELECT *
   
INTO CORRESPONDING FIELDS OF TABLE lt_vbrp UP TO 10 ROWS
   
FROM vbrp AS item
    INNER
JOIN vbrk AS header
 
ON header~vbeln = item~vbeln.


 
LOOP AT  lt_vbrp ASSIGNING <ls_vbrp>.
   
CONCATENATE <ls_vbrp>-vbeln <ls_vbrp>-posnr INTO lv_name.
   
CALL FUNCTION 'READ_TEXT'
     
EXPORTING
       
id       = '0001'
       
language = sy-langu
        name    
= lv_name
        object  
= 'VBBP'
     
TABLES
       
lines    = lt_item_txt
     
EXCEPTIONS
       
id       = 1
       
OTHERS   = 2.
   
IF sy-subrc <> 0.
     
CONTINUE.
   
ENDIF.

   
LOOP AT lt_item_txt INTO ls_item_txt.
     
CONCATENATE  <ls_vbrp>-item_txt

          ls_item_txt-tdline INTO <ls_vbrp>-item_txt.
   
ENDLOOP.

 
ENDLOOP.
  cl_salv_table
=>factory(
               
IMPORTING
                  r_salv_table  
= lr_alv
               
CHANGING
                   t_table       
= lt_vbrp  ).
 
lr_alv->display( ).


 

6.jpg


Regards

Ebrahim


Viewing all articles
Browse latest Browse all 2878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>