cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Passing the select-options data in smartforms

Former Member
0 Kudos

Dear ABAPers,

I have developed new layout for Delivery Chellan using smartforms.

using parameters i am getting document no, corresponding all details getting print.

but the client wants to use multiple document no.

in function module also i am passing only one import parameter (i.e. doc.no).

my requirement is how to pass multiple data in smartfroms.

Thanks & Regards,

Ashok

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Declare the one type in smart forms in global declaration

And declare one internal table in the forminterface with reference to that type.

And pass the multiple values to one internal table in zprogram pass the same to that function moudle and use the same in smart forms hope it will work.

Regards,

Madan.

Former Member
0 Kudos

Dear ABAPers,

Here i give my code Please check it out and tell me where i am going wrong.

&----


*& Report ZMM_DC_FORM *

*& *

&----


*& *

*& *

&----


REPORT ZMM_DC_FORM .

----


  • Data Declaration

----


tables : mseg,

mkpf,

ekpo,

ekko,

objk,

mbew,

ser03,

twlad,

makt,

adrc.

data : begin of struct_mblnr,

mblnr type mblnr,

end of struct_mblnr.

data : it_mblnr like table of struct_mblnr with header line.

data : begin of i_struct,

mblnr like mseg-mblnr,

mjahr like mseg-mjahr,

matnr like mseg-matnr,

erfmg like mseg-erfmg,

werks like mseg-werks,

lgort like mseg-lgort,

ebeln like mseg-ebeln,

ebelp like mseg-ebelp,

umwrk like mseg-umwrk,

end of i_struct.

data : begin of bednr_struct,

matnr type ekpo-matnr,

bednr type ekpo-bednr,

end of bednr_struct.

data : begin of price_struct,

matnr type mseg-matnr,

verpr type mbew-verpr,

stprs type mbew-stprs,

end of price_struct.

data : begin of serial_struct,

matnr like objk-matnr,

sernr like objk-sernr,

end of serial_struct.

data : begin of fi_struct,

matnr type mseg-matnr,

maktx type makt-maktx,

bednr type ekpo-bednr,

erfmg type mseg-erfmg,

verpr type mbew-verpr,

val_p type mbew-verpr,

end of fi_struct.

data : it_tab like table of i_struct with header line.

data : it_add1 type table of adrc with header line,

it_add2 type table of adrc with header line.

data : it_bednr like table of bednr_struct with header line.

data : it_price like table of price_struct with header line.

data : it_ser type table of ZMM_DC_SERIAL with header line.

data : it_final like table of fi_struct with header line.

data : s_date like mkpf-budat.

data : s_ebeln like ekpo-ebeln.

DATA : FM_NAME TYPE RS38L_FNAM.

----


  • Selection Screen Variables

----


selection-screen : begin of block b1 with frame title text-001.

select-options : s_mblnr for mseg-mblnr.

parameters : s_mjahr type mseg-mjahr.

selection-screen : end of block b1.

----


  • Start of Selection

----


start-of-selection.

select mblnr from mseg into table it_mblnr where mblnr ge s_mblnr-low

and mblnr le s_mblnr-high.

delete adjacent Duplicates from it_mblnr.

*loop at it_mblnr.

*

*write : it_mblnr-mblnr.

*

*endloop.

loop at it_mblnr.

select mblnr

mjahr

matnr

erfmg

werks

lgort

ebeln

ebelp

umwrk from mseg into table it_tab where mblnr = it_mblnr-mblnr

and mjahr = s_mjahr

and xauto <> 'X'.

read table it_tab index 1.

*code for PO Number

s_ebeln = it_tab-ebeln.

*code for Supplying plant address

select single adrnr from twlad into twlad-adrnr where werks = it_tab-werks

and lgort = it_tab-lgort.

select single * from adrc into it_add1 where addrnumber = twlad-adrnr.

clear twlad-adrnr.

*code for receiving plant address

select single lgort from ekpo into ekpo-lgort where ebeln = it_tab-ebeln

and ebelp = it_tab-ebelp.

select single adrnr from twlad into twlad-adrnr where werks = it_tab-umwrk

and lgort = ekpo-lgort.

select single * from adrc into it_add2 where addrnumber = twlad-adrnr.

clear : twlad-adrnr,

ekpo-lgort.

*code for the Material Document Date

select single budat from mkpf into s_date where mblnr = it_mblnr-mblnr

and mjahr = s_mjahr.

loop at it_tab.

it_final-matnr = it_tab-matnr.

it_final-erfmg = it_tab-erfmg.

*Code for Material Description

select single maktx from makt into makt-maktx where matnr = it_tab-matnr.

it_final-maktx = makt-maktx.

clear makt-maktx.

*Code for Service order Number

select single matnr

bednr from ekpo into it_bednr where ebeln = it_tab-ebeln

and ebelp = it_tab-ebelp

and matnr = it_tab-matnr.

it_final-bednr = it_bednr-bednr.

*Code for Price for the Material

select single matnr

verpr

stprs from mbew into it_price where matnr = it_tab-matnr

and bwkey = it_tab-werks.

if it_price-verpr <> 0.

it_final-verpr = it_price-verpr.

else.

it_final-verpr = it_price-stprs.

endif.

it_final-val_p = it_final-erfmg * it_price-stprs.

append it_final.

clear it_final.

endloop.

*Code for Serial Number

select single obknr from ser03 into ser03-obknr where mblnr = it_mblnr-mblnr

and vorgang = 'MMSL'.

select matnr

sernr from objk into table it_ser where obknr = ser03-obknr.

clear ser03-obknr.

*Calling Function Module for Smartform

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZMM_DC_FORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION FM_NAME

EXPORTING

L_MBLNR = it_mblnr-mblnr

L_DATE = S_DATE

L_EBELN = S_EBELN

IT_ADD1 = IT_ADD1

IT_ADD2 = IT_ADD2

TABLES

IT_FINAL = IT_FINAL

IT_SER = IT_SER.

endloop.

Please help me to solve this problem.It is very urgent.

Thanks & Regards,

Ashok.

Former Member
0 Kudos

Hi,

Check this link.I am explaining here how to use select-options in smartforms.You need to pass the select-options from program to smartforms.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501...

Regards,

Raj.

Former Member
0 Kudos

Hi,

Select-options in Smartforms:

http://www.saptechnical.com/Tutorials/Smartforms/SelectOptions/Demo.htm

Regards,

Shiva Kumar.