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

smart

Former Member
0 Likes
687

hi friendz,

i am working on custom developed smartform and print program,

below is my driver program.

but am in a confusion how to define the <b>form interface in smartform.

</b> according my requirement it is needed to use a inner join for the following select queries

plz guide me.

TABLES:vekp, "Handling Unit - Header Table

vevw, "Where-Used List for Handling Units

afvc, "Operation within an order

resb, "Reservation/dependent requirements

makt, "Material Descriptions

ausp. "Characteristic Values

----


  • Types

----


TYPES:BEGIN OF ty_resb_makt,

matnr TYPE resb-matnr,

bdmng TYPE resb-bdmng,

meins TYPE resb-meins,

charg TYPE ausp-objek,

aufpl TYPE resb-aufpl,

aplzl TYPE resb-aplzl,

objnr TYPE resb-objnr,

maktx TYPE makt-maktx,

END OF ty_resb_makt.

TYPES:BEGIN OF ty_ausp,

objek TYPE ausp-objek,

atwrt TYPE ausp-atwrt,

atinn TYPE ausp-atinn,

END OF ty_ausp.

TYPES:BEGIN OF ty_vekp,

exidv TYPE vekp-exidv,

handle TYPE vekp-handle,

vpobjkey TYPE vekp-vpobjkey,

END OF ty_vekp.

TYPES:BEGIN OF ty_vevw,

objkey TYPE vevw-objkey,

handle TYPE vevw-handle,

END OF ty_vevw.

TYPES:BEGIN OF ty_afvc,

objnr TYPE afvc-objnr,

ltxa1 TYPE afvc-ltxa1,

aufpl TYPE afvc-aufpl,

aplzl TYPE afvc-aplzl,

END OF ty_afvc.

----


  • Internal tables Declaration

----


DATA:gt_resb_makt TYPE STANDARD TABLE OF ty_resb_makt INITIAL SIZE 0,

gt_ausp TYPE STANDARD TABLE OF ty_ausp INITIAL SIZE 0.

----


  • Work area Declaration

----


DATA:wa_resb_makt TYPE ty_resb_makt,

wa_ausp TYPE ty_ausp,

wa_vekp TYPE ty_vekp,

wa_vevw TYPE ty_vevw,

wa_afvc TYPE ty_afvc.

----


  • Variables *

----


DATA: g_objkey TYPE objkey,

g_ltxa1 TYPE ltxa1.

DATA : lf_fmname TYPE rs38l_fnam.

CONSTANTS: c_fmname(25) TYPE c VALUE 'ZWM_HANDLING_UNIT_LABEL'.

----


  • S e l e c t – O p t i o n s *

  • P a r a m e t e r s *

----


SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE TEXT-001.

PARAMETERS: p_exidv LIKE vekp-exidv, "Handling Unit Number

p_objkey LIKE vevw-objkey, "Process Order Number

p_ltxa1 LIKE afvc-ltxa1, "Phase Description

p_copies(3) TYPE N. "NO of Copies to be print

SELECTION-SCREEN END OF BLOCK block1.

----


  • AT SELECTION-SCREEN

----


AT SELECTION-SCREEN.

IF p_exidv IS NOT INITIAL.

SELECT single exidv

handle

vpobjkey

FROM vekp

INTO wa_vekp

WHERE exidv = p_exidv.

ENDIF.

IF p_objkey IS NOT INITIAL.

SELECT single objkey

FROM vevw

INTO wa_vevw

WHERE handle = wa_vekp-handle

AND objkey = wa_vekp-vpobjkey

AND objkey = p_objkey.

ENDIF.

IF p_ltxa1 IS NOT INITIAL.

SELECT single objnr

ltxa1

aufpl

aplzl

FROM afvc

INTO wa_afvc

WHERE objnr = wa_vevw-objkey

AND ltxa1 = p_ltxa1 .

ENDIF.

----


  • START-OF-SELECTION

----


START-OF-SELECTION.

SELECT a~matnr

a~bdmng

a~meins

a~charg

a~aufpl

a~aplzl

a~objnr

b~maktx

INTO TABLE gt_resb_makt

FROM resb AS a INNER JOIN makt AS b

ON amatnr = bmatnr

WHERE a~objnr = wa_afvc-objnr

AND a~aufpl = wa_afvc-aufpl

AND a~aplzl = wa_afvc-aplzl.

IF gt_resb_makt[] IS NOT INITIAL.

SELECT objek

atwrt

atinn

FROM ausp

INTO TABLE gt_ausp

FOR ALL ENTRIES IN gt_resb_makt

WHERE objek = gt_resb_makt-charg

AND atinn IN ('LOBM_VFDAT','LOBM_QNDAT').

ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = c_fmname

IMPORTING

FM_NAME = lf_fmname

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

am not able to solve this problem,

regards,

siri.

3 REPLIES 3
Read only

Former Member
0 Likes
585

Check this thread out

Regards,

Santosh

Read only

Former Member
0 Likes
585

Hi,

After getting the Function module name in in the variable call this function module using call statement and pass your internal table to this Function module.

Hope this helps.

Read only

Former Member
0 Likes
585

Check the the following example from SAP system similar to your case.

SF_EXAMPLE_01