2014 Nov 18 1:08 PM
All,
I have the following requirement
We have Z custom SAP scripts and Smartforms that has been designed for usage of multiple company codes. ie 1 form has been used for multiple company codes for single output type.
Now my requirement is to create separate forms for each company code WITHOUT creating new output types.
Here all my driver programs are in Z programs
I am thinking of creating a Z table with fields such as output type, Company Code, and Form Names. and form names were maintained in this table based on output type for each company code.
Then before calling OPEN_FORM or START_FORM or SSF_FUNCTION_MODULE_NAME needs to look into the above Z table and get the form name based on Output Type Company Code and applied to OPEN_FORM, START_FORM or SSF_FUNCTION_MODULE_NAME.
Please provide your expert opinion on this
Or if you expert having better options please provide info.
Thanks
aRs
2014 Nov 18 1:21 PM
Hi,
The proposed solution will work fine for your requirement.
May be you can add one more field in the Z table named 'Form Type', to store wether the form is Script or Smartform.
And in the driver program you can simply check the form type to call either SSF_* or OPEN_* and pass the name.
2014 Nov 18 1:21 PM
Hi,
The proposed solution will work fine for your requirement.
May be you can add one more field in the Z table named 'Form Type', to store wether the form is Script or Smartform.
And in the driver program you can simply check the form type to call either SSF_* or OPEN_* and pass the name.
2014 Nov 18 1:35 PM
Nothing wrong with the way you have mentioned but I will suggest you can opt for satandard way using T-Code STVARV. You can maintain the entries here and put a select query in your program. this is common practice we are following. This maintains entry in table TVARV.
Even you can put all this form fetching logic in a function module and call your function module in driver program. Your function module will return form name based on company code.
BR,
Prakash
2014 Nov 18 2:23 PM
I am not sure about maintaining the forms name unique in TVARV table.
I am preferred to do with custom table like
Field Name | Type | Length | Description |
KSCHL | CHAR | 4 | Output Type |
BUKRS | CHAR | 4 | Company Code |
FTYPE | CHAR | 1 | Form Type SCRIPT/SMARTFORMS |
FNAME | CHAR | 40 | script Name or SMARTFORM Name |
Thanks
aRs
2014 Nov 19 8:47 AM
Hi,
Since we are using this in custom driver programs, using a custom table as you have mentioned will be more simple and flexible solution.