Skip to Content

BELNR FROM BKPF Based on RSEG.

Dear All,

I need BELNR FROM BKPF Based on RSEG-belnr.

DATA: V_BELNR LIKE BKPF-BELNR,

V_RESWK LIKE EKKO-RESWK.

DATA:B1 LIKE RSEG-BELNR,

B2 LIKE RSEG-GJAHR.

DATA:V_AWKEY LIKE BKPF-AWKEY.

DATA:V_DMBTR LIKE BSEG-DMBTR.

B1 = WA_RSEG-BELNR.

B2 = WA_RSEG-GJAHR.

CONCATENATE B1 B2 INTO V_AWKEY.

IF WA_RSEG-BELNR IS INITIAL.

CLEAR : WA_FINAL-BELNR1,WA_FINAL-BUDAT1.

ENDIF.

SELECT SINGLE BELNR INTO V_BELNR

FROM BKPF

WHERE AWKEY = V_AWKEY

AND GJAHR = WA_RSEG-GJAHR

AND BUKRS = WA_RSEG-BUKRS

and awtyp = 'RMRP'.

IF SY-SUBRC = 0.

WA_FINAL-BELNR1 = V_BELNR.

ENDIF.

My select is working fine but my problem is BKPF-BELNR getting but where Rseg-belnr is blank then it should not get bkpf-belnr.

i don't want print BKPF-BELNR WHERE RSEG-BELNR is Blank.

Please help on this.

Regards,

Parshuram

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 09, 2011 at 06:48 AM

    My Self solved.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.