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

select query in driver program for sapscript

Former Member
0 Likes
673

Hi All,

I want to select buzei, zuonr,sgtxt,meins from bseg ,temp (a temporary variable of type p deciamls 2), tmp (another temporary variable) and dmbtr from HBSEG (a structure of type bseg) . under the cond

koart ne 's' or

xauto ne 'x' or

buzid ne 't'.

I have to write this select query usinf a WORKAREA . After this select query i give WRITE_FORM as i call there vairables in script.Its very urgent.

thanks much

5 REPLIES 5
Read only

Former Member
0 Likes
632

what is the exact problem that you are facing??

Read only

Former Member
0 Likes
632

Hi can you try like this,

select a~buzei

a~ zuonr

a~sgtxt

a~meins

b~dmbtr

from bseg as a

inner join hbseg as b

into table itab

where koart ne 's' or

xauto ne 'x' or

buzid ne 't'.

you have to take the other two temporrary variable separately

and

loop at itab.

use the fm write_form.

endloop.

regards,

Venkatesh

Read only

Former Member
0 Likes
632

Hi,

select values into internal table say itab.

loop at itab.

call write_form ( place header line of itabwithin & symbol in script --- &itab-value&)

endloop.

Read only

Former Member
0 Likes
632

Hi,

You can use inner join. Consider this simple example.

data : a type zvijirank occurs 10 with header line,
          b type zvijirank1 occurs 10 with header line.

data : name like zvijirank-name,
       total like zvijirank1-total,
       reg_no like zvijirank.
*       regno type i.


data : begin of wa,
       name type zvijirank-name,
       total type zvijirank1-total,
       branch type zvijirank1-branch,
       reg_no type zvijirank-reg_no,
*       FNAME TYPE ZVIJIRANK2-F_NAME,
*       MNAME TYPE ZVIJIRANK2-M_NAME,
*       CITY TYPE ZVIJIRANK2-CITY,
*       TEL_NO TYPE ZVIJIRANK2-TEL_NO,
       end of wa.

data : it like standard table of wa with header line,
         it1 like standard table of wa with header line.

call selection-screen 9010.

select a~name b~total b~branch a~reg_no into table it from zvijirank as a inner join zvijirank1 as b on a~reg_no = b~reg_no .

loop at it.

if it-reg_no eq regno.

write : 'NAME   :', it-name,
        'REG_NO :', it-reg_no,
         'TOTAL :', it-total.

ENDIF.
endloop.

Thanks,

Reward If Helpful.

Read only

Former Member
0 Likes
632

what is your exact problem explain it clearly