on 09-13-2007 10:05 AM
Hello All,
I am developed a SMARTFORM and trying to write the print program. i wrote the code but i am getting some errors. Can any one explain whats wrong with my code. i am giving the code below:...........
TABLES: EKKO, EKPO.
DATA: BEGIN OF I_EKKO OCCURS 0,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
END OF I_EKKO.
DATA: BEGIN OF I_EKPO OCCURS 0,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
NETPR LIKE EKPO-NETPR,
END OF I_EKPO.
DATA: BEGIN OF I_OUT OCCURS 0,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
NETPR LIKE EKPO-NETPR,
END OF I_OUT.
PARAMETERS: COMPCODE LIKE EKPO-BUKRS.
SELECT EBELN BUKRS
INTO TABLE I_EKKO
FROM EKKO
UP TO 10 ROWS
WHERE BUKRS EQ COMPCODE.
IF SY-SUBRC EQ 0.
SORT I_EKKO BY EBELN.
SELECT EBELN EBELP MENGE NETPR
INTO TABLE I_EKPO
FROM EKPO
FOR ALL ENTRIES IN I_EKKO
WHERE EBELN EQ I_EKKO-EBELN.
IF SY-SUBRC EQ 0.
SORT I_EKPO BY EBELN EBELP.
ENDIF.
ENDIF.
LOOP AT I_EKKO.
MOVE: I_EKKO-EBELN TO I_OUT-EBELN,
I_EKKO-BUKRS TO I_OUT-BUKRS.
MOVE: I_EKPO-EBELN TO I_OUT-EBELP,
I_EKPO-MENGE TO I_OUT-MENGE,
I_EKPO-NETPR TO I_OUT-NETPR.
APPEND I_OUT.
ENDLOOP.
DATA: FM_NAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZRKSFEG1'
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
ARCHIVE_INDEX =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GT_OUT = I_OUT
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.
Regards
Hi,
Can you tell us what error you are geting?
Enjoy SAP.
Pankaj Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You below code looks ok, this could be the problem....
GOTO Smartform Tcode, and identify the function module name, goto your print program, click pattern and give the function module name next to call function, now replace the function module name with <b>FM_NAME</b> pass all the required parameters to the function module.
Only other problem I see is I_OUT is the internal table you created in your print program, you cannot pass the internal table directly to smartform, for this kind you can either use program line inside smartform or create a structure instead of internal table.
If useful reward points.
Regards,
Sairam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We don't know what logic you are implementing inside the program line of smartform.
But yes you will need Se38 program which will collect data based on inputs provided on selection and pass this data to smartform function module . This se38 program is similar to driver program of sapscript. and the program line of smartform is similar to calling external routine in sapscript using PERFORM.
Smartform the displays these data in proper format.
Now the error which you are getting seems like some of parameters of smartform func modu in se38 program are of differnent data type as that you have mentin in smartforms table parameter.... Can you just cross check this?
Also I want you to chekc if your form is activated. Just to be sure.
Enjoy SAP.
Pankaj Singh.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.