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

having problem in code

Former Member
0 Likes
704

Hi,

I am making a report in which i have to display the vendor payment for open items and i am facing the problem that when it moves to the 3rd table BSIK table the documenttype (BLART) get changes. i dont why why it is happening?

plzz help me out it iz really urgent to me as help will be definately rewarded.

here's d code:-

DATA: BEGIN OF ITBSIK OCCURS 0,

MBLNR LIKE MKPF-MBLNR,

XBLNR LIKE MKPF-XBLNR,

  • BLART LIKE MKPF-BLART,

BELNR LIKE BKPF-BELNR,

BUDAT LIKE BKPF-BUDAT,

BLART LIKE BSIK-BLART,

AUGBL LIKE BSIK-AUGBL,

AUGDT LIKE BSIK-AUGDT,

LIFNR LIKE BSIK-LIFNR,

WRBTR LIKE BSIK-WRBTR,

END OF ITBSIK.

*A~BLART

SELECT AMBLNR AXBLNR BBELNR BBUDAT CBLART CAUGBL CAUGDT CLIFNR C~WRBTR FROM MKPF AS A

INNER JOIN BKPF AS B ON BXBLNR = AXBLNR AND BBLART = ABLART

INNER JOIN BSIK AS C ON CXBLNR = BXBLNR "AND CBLART = BBLART

INTO TABLE ITBSIK WHERE A~XBLNR > 0.

SORT ITBSIK BY BELNR.

LOOP AT ITBSIK.

WRITE: /ITBSIK-MBLNR,ITBSIK-BELNR,ITBSIK-BUDAT,ITBSIK-BLART,ITBSIK-XBLNR,ITBSIK-AUGBL,ITBSIK-AUGDT,ITBSIK-LIFNR,ITBSIK-WRBTR.

ENDLOOP.

6 REPLIES 6
Read only

former_member226999
Contributor
0 Likes
685

Try this code:


DATA:
BEGIN OF itbsik OCCURS 0,
    mblnr LIKE mkpf-mblnr,
    xblnr LIKE mkpf-xblnr,
    belnr LIKE bkpf-belnr,
    budat LIKE bkpf-budat,
    blart LIKE mkpf-blart,
    augbl LIKE bsik-augbl,
    augdt LIKE bsik-augdt,
    lifnr LIKE bsik-lifnr,
    wrbtr LIKE bsik-wrbtr,
END OF itbsik.

*A~BLART

SELECT a~mblnr a~xblnr
       b~belnr b~budat
       c~blart c~augbl c~augdt c~lifnr c~wrbtr
  FROM mkpf AS a
 INNER JOIN bkpf AS b ON b~xblnr = a~xblnr AND b~blart = a~blart
 INNER JOIN bsik AS c ON c~xblnr = a~xblnr AND c~blart = a~blart
  INTO TABLE itbsik WHERE a~xblnr > 0.

SORT itbsik BY belnr.

LOOP AT itbsik.

  WRITE:/ itbsik-mblnr,itbsik-belnr,itbsik-budat,itbsik-blart,
       itbsik-xblnr,itbsik-augbl,itbsik-augdt,itbsik-lifnr,itbsik-wrbtr.

ENDLOOP.

Note the change in innerjoin for table C.

Reward if helps.

Fra

Read only

0 Likes
685

HI FRA,

I had tried that change u have mentioned and when i am executing this

code it does not go to output window.

i dont know why it is not displaying the output?

Edited by: abaper2008 on May 23, 2008 11:36 AM

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
685

check this code

DATA: BEGIN OF ITBSIK OCCURS 0,

MBLNR LIKE MKPF-MBLNR,

XBLNR LIKE MKPF-XBLNR,

  • BLART LIKE MKPF-BLART,

BELNR LIKE BKPF-BELNR,

BUDAT LIKE BKPF-BUDAT,

BLART LIKE BSIK-BLART,

AUGBL LIKE BSIK-AUGBL,

AUGDT LIKE BSIK-AUGDT,

LIFNR LIKE BSIK-LIFNR,

WRBTR LIKE BSIK-WRBTR,

END OF ITBSIK.

*A~BLART

SELECT AMBLNR AXBLNR BBELNR BBUDAT CBLART CAUGBL CAUGDT CLIFNR C~WRBTR INTO TABLE ITBSIK FROM ( ( MKPF AS A

INNER JOIN BKPF AS B ON BXBLNR = AXBLNR AND BBLART = ABLART )

INNER JOIN BSIK AS C ON CXBLNR = BXBLNR "AND CBLART = BBLART )

AND WHERE A~XBLNR > 0.

SORT ITBSIK BY BELNR.

LOOP AT ITBSIK.

WRITE: /ITBSIK-MBLNR,ITBSIK-BELNR,ITBSIK-BUDAT,ITBSIK-BLART,ITBSIK-XBLNR,ITBSIK-AUGBL,ITBSIK-AUGDT,ITBSIK-LIFNR,ITBSIK-WRBTR.

ENDLOOP.

REWARD IF IT IS HELPFULL

Read only

0 Likes
685

hi always learner,

i am trying ur code but it is giving error:-

SELECT AMBLNR AXBLNR BBELNR BBUDAT CBLART CAUGBL CAUGDT CLIFNR C~WRBTR INTO TABLE ITBSIK FROM ( ( MKPF AS A

INNER JOIN BKPF AS B ON BXBLNR = AXBLNR AND BBLART = ABLART )

INNER JOIN BSIK AS C ON CXBLNR = BXBLNR "AND CBLART = BBLART )

WHERE A~XBLNR > 0.

error:-

"(" has no closing ")"

what should i do,it doesn't work.

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
685

SELECT AMBLNR AXBLNR BBELNR BBUDAT CBLART CAUGBL CAUGDT CLIFNR C~WRBTR INTO TABLE ITBSIK FROM ( ( MKPF AS A

INNER JOIN BKPF AS B ON BXBLNR = AXBLNR AND BBLART = ABLART )

INNER JOIN BSIK AS C ON CXBLNR = BXBLNR ) and

WHERE A~XBLNR > 0.

now check this code...

with regards

always learner...

Read only

0 Likes
685

HI,

I had modified the code as you had said but it is giving the right output as the blart field had changed. accoring to the fico person the blart always remains the same through out its clearing and here in dis code it is changing.

I had found something in BKPF table i.e. AWKEY n AWTYPE , they use to store the mkpf-mblnr and mjahr field.the problem is how to reterive this data from it as it will be more helpful in tracing the a/c document no.