‎2008 Jan 22 1:01 PM
Hi All,
Could you please help how i connect to smartform layout from this below code. my requriment is from below code i need to connect to the smartform . My doubt what is the internal table to connect with smartform though they used memory id in this below code.
PERFORM get_data.
FORM get_data .
data: wf_LGPBE like mard-LGPBE.
*... get the order data from memory, not there ABEND !!!!!!
PERFORM only_order_data_import
TABLES
op_print_tab
ihpad_tab
ihsg_tab
ihgns_tab
iafvgd
iripw0
iresbd
iaffhd
CHANGING
caufvd
riwo1
iloa.
IF syst-subrc <> 0.
MESSAGE a650(id). " import failed
ENDIF.
SELECT SINGLE tidnr FROM equz " Technical ID Num
INTO wf_tidnr
WHERE equnr = caufvd-equnr.
Warranty end date
Fetch Object Number from EQUI
SELECT SINGLE objnr FROM equi
INTO wf_objnr
WHERE equnr = caufvd-equnr.
Fetch warranty End
*Warranty Type: Vendor/Manufacturer warranty : 2
SELECT SINGLE gwlen FROM bgmkobj
INTO wf_gwlen
WHERE j_objnr EQ wf_objnr
AND gaart EQ '2'.
SELECT SINGLE txt FROM t003p INTO wf_autxt
WHERE spras = sy-langu
AND auart = caufvd-auart.
SELECT SINGLE herst serge FROM itob
INTO (wf_herst , wf_serge)
WHERE equnr = caufvd-equnr.
ENDFORM. " get_data
*&----
*
*& Form ONLY_ORDER_DATA_IMPORT
*&----
*
FORM only_order_data_import
TABLES
ct_op_print_tab TYPE type_op_print_tab
ct_ihpad_tab TYPE type_ihpad_tab
ct_ihsg_tab TYPE type_ihsg_tab
ct_ihgns_tab TYPE type_ihgns_tab
ct_iafvgd TYPE type_afvgd " Order operations
ct_iripw0 TYPE type_ripw0 " Order object list
ct_iresbd TYPE type_resbd " Material Reservations
ct_iaffhd TYPE type_affhd " prod resources and tools
CHANGING
cs_caufvd TYPE caufvd " Order header details
cs_riwo1 TYPE riwo1 " ILOA dialogarea
cs_iloa TYPE iloa. " Location and account details
IMPORT
Structures
caufvd TO cs_caufvd " Order header details
riwo1 TO cs_riwo1 " ILOA dialogarea
iloa TO cs_iloa " Location and account details
Tables
iafvgd TO ct_iafvgd " Order operations
iripw0 TO ct_iripw0 " Order object list
iresbd TO ct_iresbd " Material Reservations
iaffhd TO ct_iaffhd " prod resources and tools
op_print_tab TO ct_op_print_tab " Individual print of operations
ihpad_tab TO ct_ihpad_tab
ihsg_tab TO ct_ihsg_tab
ihgns_tab TO ct_ihgns_tab
FROM MEMORY ID id_iprt_orddata.
ENDFORM. "ONLY_ORDER_DATA_IMPORT
please help me out.
will get award for correct answer
Thanks
‎2008 Jan 22 1:13 PM
You have to generate the smartform, this is done using a function that is related to the smartform.
Because the generated functionname of the smartform changes from system to system (dev - acc - prod), you first have to look up the current function name.
This is done using function: SSF_FUNCTION_MODULE_NAME.
This returns you the name of the function (of the Smartform ) that you can call to generate the Smartform.
‎2008 Jan 22 1:26 PM
Hi
for every SMARTFORM you develop it wil genarate a Function Module
just use that FM in your program so that SMRTFORM will call
*--Getting the function module of smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSF_BILLING'
IMPORTING
FM_NAME = V_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I000(Z00) WITH 'Error in generating the function module'.
ELSE.
CALL FUNCTION V_FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
COMP_ADD = COMP_ADDR
XVBRK = VBRK
V_LANDX = V_LANDX
V_LTEXT = V_LTEXT
V_C_ADRNR = V_C_ADRNR
V_VTEXT = V_VTEXT
TABLES
IT_VBRP = IT_VBRP
IT_KONV = IT_KONV
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.