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

whats wrong with this code logic ?

Former Member
0 Likes
999

Hellom

check out this code.

loop at t_bseg into wa_bseg.

at new belnr.

// is this following also correct or wrong

if KOART EQ 'K'.

// pick up vendor's WRBTR

ELSE

// pick up other line item's WRBTR ( how ?? )

endif.

endat.

endloop.

basically what i wanna do is, iterate thru bseg and select vendor line item and other line items separately(cuz i have to show them in different columns).

but when i do,

AT NEW BELNR.

IF bseg-KOART EQ 'K'.

//

ENDIF.

ENDAT.

i am getting no value, whereas i get value when i remove the 'AT NEW BELNR' condition.

Thanks,

Shehryar Dahar

1 ACCEPTED SOLUTION
Read only

Manohar2u
Active Contributor
0 Likes
960

Use <b>wa_bseg</b> values for codition checks in <b>at new</b> and <b>end at</b>.

Regds

Manohar

10 REPLIES 10
Read only

Former Member
0 Likes
960

Within the at new end at stmnts, other than belnr, all the fields have *. That is why you are not seeing anything.

Read only

abdul_hakim
Active Contributor
0 Likes
960

hi

<b>Between AT and ENDAT the content of workarea will not contain any value.</b>

Cheers,

Abdul Hakim

Mark all useful answers.Plz close the thread if your question has been answered.

Read only

0 Likes
960

Hi,

then maybe u can help me out. Suppose i have made a payment ( document type 'KZ')


                debit         credit
bank            9,500                
Tax              500
vendor                        10,000

I am making a report for cleared items (document type 'KZ') in which i have 3 columns in which i have to show sumthing like this(against each vendor in the bseg),

col1 col2 col 3

10,000 9,500 500

each line item in my report will be of a vendor so i have to give a consition like (KOART = 'K') but i also have to show WRBTR of other line items(of the same document) in the respective columns.

can you demostrate with an example or sumthing..

thanks.

Shehryar

Message was edited by: shehryar dahar

Read only

Manohar2u
Active Contributor
0 Likes
961

Use <b>wa_bseg</b> values for codition checks in <b>at new</b> and <b>end at</b>.

Regds

Manohar

Read only

Former Member
0 Likes
960

Hi manohar,

i didnt get it. Can u plz demonstrate with an example?

Thanks.

Read only

0 Likes
960

Could you please paste ur complete code here not like

// is this following also correct or wrong

which is causing problem..

Cheers,

Abdul Hakim

Read only

Manohar2u
Active Contributor
0 Likes
960

AT NEW BELNR.

*IF bseg-KOART EQ 'K'.

*//

*ENDIF.

if wa_bseg-koart eq 'K'. ---> Use wa_bseg

endif.

ENDAT.

Read only

Former Member
0 Likes
960

Hi ,

Manohar...yes i am using wa_bseg .. but its same problem.

Read only

Former Member
0 Likes
960

Hi,

Abdul.. can u see my post in this thread 'Jul 28, 2006 5:31 PM'

basically i am looping thru bseg(all item of document type 'KZ'). When i come across a document number(suppose it has three line items, 2 debit line items(bank and tax) and 1 credit line item(vendor). i want to show sumthing like this in my report,



col1              col2          col3           col4

vendor name    credit(WRBTR)  debit(WRBTR)   debit(WRBTR)
....            ....             .....          .....
....            ....             .....          .....

How to go on doing this ?

Read only

0 Likes
960

use this code

loop at t_bseg.

move t_bseg into wa_bseg.

at new belnr.

// is this following also correct or wrong

if WA_BSEG-KOART EQ 'K'.

// pick up vendor's WRBTR

ELSE

// pick up other line item's WRBTR ( how ?? )

endif.

endat.

endloop.