07-24-2008 7:01 AM
HI,
i have developed a smartform and written a print program and in the print program i have written the logic and calling the smartform under form ENTRY_NEU.
Now i have given the print program name ,form name and smartform name in NACE.
While executing ME22N Print Preview im getting someother PO smartform but not the screen field value as in ME22N.
i code is.
REPORT ZPURC.
TABLES:EKPO,
nast.
Data: p_ebeln type ekko-ebeln.
&----
*& Form entry_neu
&----
form entry_neu using ent_retco ent_screen.
data:v_fname type RS38L_FNAM.
*get parameter id 'BES' FIELD P_EBELN.
select objky from nast into P_ebeln where
kappl = 'EF'
AND KSCHL = 'NEU'
AND SPRAS = SY-LANGU
AND NACHA = '1'
AND OBJTYPE = 'BUS2012'.
ENDSELECT.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZPURC'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = v_fname
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 V_FNAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
P_EBELN = P_EBELN
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
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.
ENDFORM. "entry_neu
_----
to get the value from screen field i tried with get parameters also.kindly help me in resolving this issue.
thanks and regards,
siri
07-24-2008 7:08 AM
Hi Siri,
If my understanding is correct then u have maintained ur smartform along with driver program against a output type in nace. Now u have to maintain some condition records for which this output type should trigger. And in ME22N use that condition record so that if u choose the output type it should trigger ur smartform.
Regards,
Joy.
07-24-2008 7:08 AM
hi,
Use the function module call function 'ME_READ_PO_FOR_PRINTING'
exporting
ix_nast = nast
ix_screen = ent_screen
importing
ex_retco = ent_retco
ex_nast = l_nast
doc = l_doc
changing
cx_druvo = l_druvo
cx_from_memory = l_from_memory.
for fetching the nast key and use the same details for printing.
Regards,
Veeresh
07-24-2008 7:09 AM
Now i have given the print program name ,form name and smartform name in NACE.
form name for script.
Give only program name and smartform name.
try this.
Regards
Anbu
07-24-2008 7:29 AM
hi,
i have tried all the options given by you all but my question is not yet solved .
i am not getting the same PO number which is given in ME22N
instead it is displaying another random PO number in the smartform kindly help me .
thanks and regards,
siri