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

Reg : Report

mallikarjun_vaja
Participant
0 Likes
774

hi,

Iam fetching data from Bseg into an int.table (I_BSEG) based on few conditions

IF NOT I_bkpf[] IS INITIAL.

SELECT BUKRS BELNR GJAHR AUGBL WRBTR wmwst LIFNR sknto ebeln NEBTR

FROM BSEG

INTO TABLE I_BSEG

FOR ALL ENTRIES IN I_BKPF

WHERE BUKRS = I_BKPF-BUKRS

AND BELNR = I_BKPF-BELNR

AND GJAHR = I_BKPF-GJAHR.

endif.

Now I need to get check numbers(PAYR-CHECT) from PAYR table for corresponding clearing documents(AUGBL FROM BSEG)

if not i_bseg[] is initial.

SELECT CHECT VBLNR

FROM PAYR

INTO TABLE I_PAYR

FOR ALL ENTRIES IN I_BSEG

WHERE VBLNR = I_BSEG-AUGBL AND

RZAWE = 'C'.

endif.

Now my exact requirement is ::

For each clearing document I got 3 check numbers.

How can I display all the 3 check no's for each clearing document in the output table

More clearly.....

I got a AUGBL value from BSEG and for this AUGBL i have 3 check no's in PAYR table.

I want to disaply AUGBL and corresponig 3 check numbers in the output.

plz help me

its urgent.

waiting for ur replies

Best Regards

Vaja

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
752

Hi,

Can you paste your whole code.

What you need to do is something like this

LOOP AT i_bseg

LOOP AT i_payr where ...

....move data to output table.

ENDLOOP

ENDLOOP>

Regards,

Atish

hi,

Iam fetching data from Bseg into an int.table (I_BSEG) based on few conditions

IF NOT I_bkpf[] IS INITIAL.

SELECT BUKRS BELNR GJAHR AUGBL WRBTR wmwst LIFNR sknto ebeln NEBTR

FROM BSEG

INTO TABLE I_BSEG

FOR ALL ENTRIES IN I_BKPF

WHERE BUKRS = I_BKPF-BUKRS

AND BELNR = I_BKPF-BELNR

AND GJAHR = I_BKPF-GJAHR.

endif.

Now I need to get check numbers(PAYR-CHECT) from PAYR table for corresponding clearing documents(AUGBL FROM BSEG)

if not i_bseg[] is initial.

SELECT CHECT VBLNR

FROM PAYR

INTO TABLE I_PAYR

FOR ALL ENTRIES IN I_BSEG

WHERE VBLNR = I_BSEG-AUGBL AND

RZAWE = 'C'.

endif.

Now my exact requirement is ::

For each clearing document I got 3 check numbers.

How can I display all the 3 check no's for each clearing document in the output table

More clearly.....

I got a AUGBL value from BSEG and for this AUGBL i have 3 check no's in PAYR table.

I want to disaply AUGBL and corresponig 3 check numbers in the output.

plz help me

its urgent.

waiting for ur replies

Best Regards

Vaja

5 REPLIES 5
Read only

Former Member
0 Likes
753

Hi,

Can you paste your whole code.

What you need to do is something like this

LOOP AT i_bseg

LOOP AT i_payr where ...

....move data to output table.

ENDLOOP

ENDLOOP>

Regards,

Atish

Read only

0 Likes
752

hi Atish,

*select project(s) def(pspnr)

SELECT PSPNR FROM PROJ INTO TABLE I_PROJ

WHERE PSPID IN S_PSPID.

IF NOT I_PROJ[] IS INITIAL.

  • select WBS(posid)

SELECT POSID OBJNR PRART

FROM PRPS

INTO TABLE I_PRPS

FOR ALL ENTRIES IN I_PROJ

WHERE PSPHI = I_PROJ-PSPNR

AND BELKZ <> SPACE.

endif.

IF NOT I_PRPS[] IS INITIAL.

Select REFBN REFBK REFGJ

from COVP

INTO TABLE I_COVP

FOR ALL ENTRIES IN I_PRPS

where OBJNR = I_PRPS-OBJNR .

IF NOT I_covp[] IS INITIAL.

SELECT BUKRS BELNR GJAHR XBLNR BUDAT

FROM BKPF

INTO TABLE I_BKPF

FOR ALL ENTRIES IN I_COVP

WHERE BUKRS = I_COVP-REFBK

AND BELNR = I_COVP-REFBN

AND GJAHR = I_COVP-REFGJ.

endif.

IF NOT I_bkpf[] IS INITIAL.

SELECT BUKRS BELNR GJAHR AUGBL WRBTR wmwst LIFNR sknto ebeln NEBTR

FROM BSEG

INTO TABLE I_BSEG

FOR ALL ENTRIES IN I_BKPF

WHERE BUKRS = I_BKPF-BUKRS

AND BELNR = I_BKPF-BELNR

AND GJAHR = I_BKPF-GJAHR.

endif.

if not i_bseg[] is initial.

SELECT CHECT VBLNR

FROM Z_PAYR

INTO TABLE I_PAYR

FOR ALL ENTRIES IN I_BSEG2

WHERE VBLNR = I_BSEG2-AUGBL AND

RZAWE = 'C'.

Now In this I_PAYR ,,I have 3 check no's(CHECT) for each AUGBL from BSEG..

I want to move 3 check no's for each AUGBL into I_BSEG int.table.

plz help with code

waiitng for ur reply

regards

Vaja

Read only

0 Likes
752

Hi,

LOOP A i_bseg.

LOOP AT i_payr where vblnr = i_bseg-vblnr.

..create new table and append here output table.

ENDLOOP.

ENDLOOP.

Regards,

Atish

Read only

Former Member
0 Likes
752

DO THIS.

LOOP AT I_BSEG.

T_OUT-AUGBL = I_BSEG-AUGBL.

LOOP AT I_PYAR WHERE VBLNR = I_BSEG-AUGBL.

T_OUT-CHECT = T_PYAR-CHECT.

APPENT T_OUT.

CLEAR I_PYAR.

ENDLOOP.

ENDLOOP.

give point if its helpful.

Jitendra

Read only

Former Member
0 Likes
752

Hi Mallikarjun,

First loop through i_bseg table and for each entry in i_bseg loop through i_payr.

this solves ur problem.

LOOP AT i_bseg.

LOOP AT i_payr WHERE condition.

append to i_output.

ENDLOOP.

ENDLOOP.