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

selecting user input from Select option into smart form

Former Member
0 Likes
2,525

Hi,

when i use parameter then i wil show company code in smart-form output

but when i use select option then its throwing error parameter specified here is different

what should i do in this case i want to design a big select option screen for taking user input

REPORT  ZMM.

TABLES BSEG.

DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
       V_FMNAME TYPE RS38L_FNAM.

*PARAMETERS SO_BUKRS TYPE BUKRS.

SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.

DATA : Z_CONTROL TYPE SSFCTRLOP,      "Smart Forms: Control structure
        Z_OPTIONS TYPE SSFCOMPOP.      "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog,        "SAP Smart Forms: General Indicator
               Z_options-tdnewid,          "New Spool Request (Print Parameters)
               z_control-PREVIEW.         "Print preview

MOVE 'LP01' TO Z_options-tddest.         "Spool: Output device
MOVE space  TO Z_options-tdimmed.        "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device.      "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME = V_FORMNAME
  IMPORTING
    FM_NAME  = V_FMNAME.
CALL FUNCTION V_FMNAME
  EXPORTING
    CONTROL_PARAMETERS = Z_CONTROL
    OUTPUT_OPTIONS     = Z_OPTIONS
    USER_SETTINGS      = ''
    BUKRS              = SO_BUKRS.

pls help me in this regards.

ketan..

Hi,

when i use parameter then i wil show company code in smart-form output

but when i use select option then its throwing error parameter specified here is different

what should i do in this case i want to design a big select option screen for taking user input

REPORT  ZMM.

TABLES BSEG.

DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
       V_FMNAME TYPE RS38L_FNAM.

*PARAMETERS SO_BUKRS TYPE BUKRS.

SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.

DATA : Z_CONTROL TYPE SSFCTRLOP,      "Smart Forms: Control structure
        Z_OPTIONS TYPE SSFCOMPOP.      "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog,        "SAP Smart Forms: General Indicator
               Z_options-tdnewid,          "New Spool Request (Print Parameters)
               z_control-PREVIEW.         "Print preview

MOVE 'LP01' TO Z_options-tddest.         "Spool: Output device
MOVE space  TO Z_options-tdimmed.        "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device.      "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME = V_FORMNAME
  IMPORTING
    FM_NAME  = V_FMNAME.
CALL FUNCTION V_FMNAME
  EXPORTING
    CONTROL_PARAMETERS = Z_CONTROL
    OUTPUT_OPTIONS     = Z_OPTIONS
    USER_SETTINGS      = ''
    BUKRS              = SO_BUKRS.

pls help me in this regards.

ketan..

13 REPLIES 13
Read only

Former Member
0 Likes
1,980

Hi,

In you smartform interface,Bukrs is define as TYPE BUKRS, So it can only accept single value. Your select option is kind of internal table, so change your form interface in smartform so that it can accept table also.

Edited by: Anurag_n on Apr 5, 2010 12:33 PM

Read only

0 Likes
1,980

hi

thnx for your reply

can u pls elaborate in my code

now i changed code BUKRS = SO_BUKRS-low.

either i can give low or high but how to select from range

REPORT  ZMM.
 
TABLES BSEG.
 
DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
       V_FMNAME TYPE RS38L_FNAM.
 
*PARAMETERS SO_BUKRS TYPE BUKRS.
 
SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
 
DATA : Z_CONTROL TYPE SSFCTRLOP,      "Smart Forms: Control structure
        Z_OPTIONS TYPE SSFCOMPOP.      "SAP Smart Forms: Smart Composer (transfer) options.
MOVE 'X' TO : Z_control-no_dialog,        "SAP Smart Forms: General Indicator
               Z_options-tdnewid,          "New Spool Request (Print Parameters)
               z_control-PREVIEW.         "Print preview
 
MOVE 'LP01' TO Z_options-tddest.         "Spool: Output device
MOVE space  TO Z_options-tdimmed.        "Print Immediately (Print Parameters).
MOVE 'PRINTER' TO Z_control-device.      "Output device
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME = V_FORMNAME
  IMPORTING
    FM_NAME  = V_FMNAME.
CALL FUNCTION V_FMNAME
  EXPORTING
    CONTROL_PARAMETERS = Z_CONTROL
    OUTPUT_OPTIONS     = Z_OPTIONS
    USER_SETTINGS      = ''
    BUKRS              = SO_BUKRS-low.

ketan..

Read only

0 Likes
1,980

Hi,

Either you change the smartform interface BUKRS to table of type SELOPT. or select the company code from table t001 based on the selection screen field and pass the required company code value to BUKRS.

Hope this will help.

Regards

Shibino

Read only

Rocky1
Product and Topic Expert
Product and Topic Expert
0 Likes
1,980

Hi Ketan,

If you write so_bukrs-low, it will pass a single value to the smartform and will not consider any other value even if it is entered.

Thanks & Regards

Rocky

Read only

0 Likes
1,980

Hi,

Open Smartform--->Form interface>import-->(parameter name)bukrs (type assignment ) TYPE , (Associated type) T_BUKRS.

or you can paas it through table parameter there, this is similar to how we pass table in function module.

but my question what you going to do with list of Bukrs in smart form?

Edited by: Anurag_n on Apr 5, 2010 12:44 PM

Edited by: Anurag_n on Apr 5, 2010 12:45 PM

Read only

0 Likes
1,980

In continuation of my earlier reply.

Decalre your internal table in form interface as well and you will have the complete list of BUKRS in your internal table and you can use it as you want to.

Read only

0 Likes
1,980

hi

thanx for ur reply

i know low and high use but i want company code 0550 to 0850

so how can i select into smart forms using select options.

ketan

Read only

0 Likes
1,980

hi,

In smartform interface declare BUKRS as table of type selopt.

Pass the select option table to S_BUKRS[] to new interface table.

Regards

Shibino

Read only

0 Likes
1,980

Hi,

Basically you need to pass the select option as a table from the program and then from the smartform, you need to use it.

http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/abap-code-samp...

Check the above link. I have explained the same in step by step procedure.

Read only

Former Member
0 Likes
1,980

You are getting this error bcoz of the type conflict.

I assume that you want to pass multiple values for BUKRS.This can be achieved by using an internal table having bukrs as a field and before passing to the FM fill this internal table with all the values from the select option.Pass this internal table to the FM

Data:begin of itab occurs 0

bukrs like bukrs,

end of itab.

Fiil this itab with select option values.

Call function SSF_.....

eXPORTING

'

'

iTAB = ITAB

This will solve your issue.

Read only

Former Member
0 Likes
1,980

Hi Ketan,

" Any Confusion Still

In your Smarform Form Interface change bukrs type as TRGS_COMPANY_CODE This is of type Ranges

then activate your smartform and program as well and execute it

Cheerz

Ram

Read only

0 Likes
1,980

hi

thanx for your reply

i used BUKRS TYPE TRGS_COMPANY_CODE

in form interface but when i run the driver program then its showing

field bukrs invalid type 'U'

i want the output in the form of range how can i do so

i know how to declare

tables

it = it.

but in my case i don used any tables

pls give details

ketan..

Read only

Former Member
0 Likes
1,980

Hi Ketan,

You can declare your company code S_BURKS as of TYPE SELOPT in the TABLE section of smartform interface declaraction.

Thanks,

Chinmay