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

Please help me to modify the code here !!!!

Former Member
0 Likes
766

hi every one

in my report i have written like this

report zxxx.

.........

data: begin of itab occurs 0

.... .....

.........

vtext4 like tpart-vtext

.........

end of itab.

data: begin t_tpart occurs 0.

......

.......

vtext4 like tpart-vtext

end of t_tpart.

SELECT vbeln

posnr

kunnr

adrnr

parvw

FROM vbpa

INTO CORRESPONDING FIELDS OF TABLE t_vbpa

where vbpa~vbeln eq s_vbeln.

.....

.....

SELECT SPRAS PARVW VTEXT

FROM TPART

INTO CORRESPONDING FIELDS OF TABLE T_TPART

FOR ALL ENTRIES IN T_VBPA

WHERE SPRAS = SY-LANGU

AND PARVW = T_VBPA-PARVW.

IF SY-SUBRC EQ 0.

SORT T_TPART BY PARVW.

......

......

loop at t_tpart.

READ TABLE t_tparT WITH KEY PARVW = t_vbpa-PARVW BINARY SEARCH.

itab-parvw = t_tpart-parvw.

itab-VTEXT3 = t_tparT-VTEXT4.

endloop.

Here while printing at loop at itab i am gettng different partner type but not able to fetch data from vtext of table tpart i.e partner type description......plz help

7 REPLIES 7
Read only

Former Member
0 Likes
737

Hi,

Either remove the "BINARY SEARCH" addition, or make sure PARVW is the first element of structure T_TPART.

Regards,

John.

Read only

Former Member
0 Likes
737

Hi... write logic as below..

loop at t_vbpa.

READ TABLE t_tpart WITH KEY PARVW = t_vbpa-PARVW BINARY SEARCH.

itab-parvw = t_tpart-parvw.

itab-VTEXT3 = t_tparT-VTEXT4.

append itab.

clear itab.

endloop.

Reward me.. if i helps you.

Thanks,

Murali.

Read only

Former Member
0 Likes
737

Hi,

Either you can remove the 'BINARY SEARCH' addition from READ TABLE or sort the t_tpart table by parvw.

Rgds,

Bujji

Read only

Former Member
0 Likes
737

loop at t_vbpa instead of t_tpart. Clear the work area at the end of the loop :


loop at t_vbpa.
READ TABLE t_tparT WITH KEY PARVW = t_vbpa-PARVW BINARY SEARCH.
itab-parvw = t_tpart-parvw.
itab-VTEXT3 = t_tparT-VTEXT4.
append itab to itab.
clear: t_tpart, itab, t_vbpa.
endloop.

Edited by: Abhishek Sarkar on Feb 5, 2008 8:23 AM

Read only

0 Likes
737

hEY STILL ITS NOT COMIING

Read only

0 Likes
737

Hi,

Remove the Binary search addition in the code and append to itab as below:

loop at t_tpart.

READ TABLE t_tparT WITH KEY PARVW = t_vbpa-PARVW.

itab-parvw = t_tpart-parvw.

itab-VTEXT3 = t_tparT-VTEXT.

append itab.

endloop.

reward if helpful,

cs

Read only

0 Likes
737

before looping sort the both tables by reading key, if you are using the Binary Search as addition

to the read statement u have to sort the tables with key, its a mandatory and use sy-subrc,

if sy-subrc eq 0, then only display the value else leave it blank or write the appropriate statement over there.

Regards

Praveen