Application Development 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: 

SELECT STATEMENT (Correct answers will be given full points.)

Former Member
0 Kudos
181

HI Gurus

I am new abap help me with the select statement for these please

Get BKPF-AWKEY where BKPF-BELNR = VBRK-VBELN + prefix “00”.

this is the reference number for printing in script(SD)

i need to write in the text elements

Get KNA1- STCEG where VBRK-KUNRG = KNA1-KUNNR This is the GST REG

how to write in the text elements.

Correct answers will be given full points.

thanks & regards

sirish.

6 REPLIES 6

rajesh_akarte2
Active Participant
0 Kudos
75

Hi sirish,

First of all to add the prefix to vbrk-vbeln u can write the syntax like this-

CONCATENATE '00' VBRK-VBELN INTO VBRK-VBELN.

if 00 is suffix then write like this--

CONCATENATE VBRK-VBELN '00' INTO VBRK-VBELN.

Now u can write ur first select query like this-

SELECT awkey FROM bkpf

WHERE belnr = vbrk-vbeln.

Syntax for second select query-

SELECT stceg FROM kna1

WHERE kunnr = vbrk-kunrg.

Reward if useful.

Regards,

Rajesh Akarte

0 Kudos
75

HI Rajesh,

i want to write this in scripts text elements. how to write this in text elements.

thanks & regards

sirish

0 Kudos
75

Hi..

Write the query in program form(subroutine) n call the subroutine form the script using

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM

0 Kudos
75

Hi bhaskaran,

Can you please tell me what exactly to write in the program and the text element please. its urgent.

Points will be fully awarded.

Thanks&Regards

sirish

0 Kudos
75

In script u can write like this

/: PERFORM getdetails IN PROGRAM ZPROG

/: USING &vbeln&

/: CHANGING &v_STCEG&

/: CHANGING &v_AWKEY&

/: ENDPERFORM

in ur ZPROG create one subroutine named getdetails

what ever u r passing from perform wil b der in in_tab(u hav to declare in_tab n out_tab of type itcsy)

extract values from in_tab..

use select query for fetching data

pass output to out_tab

FORM getdetails TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

declare v_STCEG,v_AWKEY

...

ENDFORM.

0 Kudos
75

hi

write like this

Mtrl.Code Description Quantity Value

&uline(70) &

&i_inv-matnr& &i_inv-arktx&

like this which field u want write in that form .

ok