Application Development 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: 

Smartforms o/p 2 PDF conversion problem , plz see my code

Former Member
0 Kudos

Hi Smartform Guys

1)I m getting error <b>"CONVT_NO_NUMBER "</b> in converting my Smartform output to PDF.

*----


*

*Printing of Export Invoice, Packing List,Enclosure to Packing List & *

*Case Marking in one SMART FORMS Layout *

----


REPORT ZSD_REP_MULTI_PRINT.

TABLES :

vbak,

vbap,

vbpa,

vbfa,

VBRK,

VBRP,

LIKP,

LIPS,

KONV,

objk,

tvko,

ser01,

sadr,

equi,

makt,

mast,

t005t,

kna1,

t001w,

T001,

ADRC,

sscrfields,

zpp_plcmi, "Packing list history For Conf: Item data

zplh, "PACKING LIST HISTORY : HEADER DATA

zpli. "PACKING LIST HISTORY : ITEM DATA

DATA: FM_NAME TYPE RS38L_FNAM,

P_E_DEVTYPE TYPE RSPOPTYPE,

P_JOB_OUTPUT_INFO TYPE SSFCRESCL OCCURS 2000 WITH HEADER LINE,

P_OUTPUT_OPTIONS TYPE SSFCOMPOP OCCURS 0 WITH HEADER LINE,

P_CONTROL_PARAMETERS TYPE SSFCTRLOP OCCURS 0 WITH HEADER LINE ,

P_DOC LIKE DOCS OCCURS 2000 WITH HEADER LINE,

P_LINES LIKE TLINE OCCURS 200,

P_BIN_FILESIZE TYPE I,

P_LANGUAGE TYPE SFLANGU,

P_BIN_FILE TYPE XSTRING.

DATA: T_ITEM TYPE ZSD_TABL_LITEM,

WA_ITEM TYPE ZSD_STRUCT_LITEM,

T_ADRS LIKE ZSD_STRUCT_ADRS OCCURS 0 WITH HEADER LINE,

MSLINES LIKE TLINE OCCURS 1 WITH HEADER LINE,

TIDNO LIKE STXL-TDID,

TNAME LIKE STXL-TDNAME,

TOBJT LIKE STXL-TDOBJECT,

SSORD LIKE VBAK-VBELN,

TOT LIKE VBAK-NETWR,

WORD LIKE SPELL.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS: P_DELNO LIKE LIKP-VBELN OBLIGATORY,

P_INVNO LIKE VBRK-VBELN OBLIGATORY,

P_DATE LIKE SY-DATUM.

SELECTION-SCREEN END OF BLOCK blk1.

AT SELECTION-SCREEN.

CLEAR T_ADRS.

REFRESH T_ITEM.

T_ADRS-INVNO = P_INVNO.

T_ADRS-INVDAT = P_DATE.

SELECT SINGLE VBELV INTO VBFA-VBELV

FROM VBFA

WHERE VBELN = P_DELNO

AND VBTYP_N = 'J' .

SSORD = VBFA-VBELV.

*Exporter's Address

SELECT SINGLE BUKRS_VF INTO VBAK-BUKRS_VF

FROM VBAK

WHERE VBELN = VBFA-VBELV.

SELECT SINGLE ADRNR

INTO T001-ADRNR

FROM T001

WHERE BUKRS = VBAK-BUKRS_VF.

SELECT SINGLE NAME1 STREET CITY1 POST_CODE1 COUNTRY

INTO (T_ADRS-NAME1,T_ADRS-STREET,T_ADRS-CITY1,

T_ADRS-POST_CODE1, ADRC-COUNTRY)

FROM ADRC

WHERE ADDRNUMBER EQ T001-ADRNR.

SELECT SINGLE LANDX

INTO T_ADRS-COUNTRY

FROM T005T

WHERE SPRAS = 'EN'

AND LAND1 = ADRC-COUNTRY.

**BUYERS NO & DATE

*

  • SELECT SINGLE BSTNK BSTDK INTO (T_ADRS-BSTNK,T_ADRS-BSTDK)

  • FROM VBAK

  • WHERE VBELN = VBFA-VBELV.

*Consignee Address & Buyer Other Than Consignee

SELECT SINGLE KUNNR KUNAG INTO (LIKP-KUNNR, LIKP-KUNAG)

FROM LIKP WHERE VBELN = P_DELNO.

IF LIKP-KUNNR = LIKP-KUNAG.

SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR

INTO (T_ADRS-CNAME1, T_ADRS-CNAME2, T_ADRS-CSTREET,

T_ADRS-CCITY, T_ADRS-CPCODE, T_ADRS-CREGIO,

T_ADRS-CTELF1, KNA1-ADRNR)

FROM KNA1

WHERE KUNNR = LIKP-KUNNR.

SELECT SINGLE COUNTRY INTO ADRC-COUNTRY

FROM ADRC

WHERE ADDRNUMBER EQ KNA1-ADRNR.

SELECT SINGLE LANDX

INTO T_ADRS-CCOUNTRY

FROM T005T

WHERE SPRAS = 'EN'

AND LAND1 = ADRC-COUNTRY.

T_ADRS-ONAME1 = T_ADRS-CNAME1 .

T_ADRS-ONAME2 = T_ADRS-CNAME2 .

T_ADRS-OSTREET = T_ADRS-CSTREET .

T_ADRS-OCITY = T_ADRS-CCITY.

T_ADRS-OPCODE = T_ADRS-CPCODE .

T_ADRS-OREGIO = T_ADRS-CREGIO.

T_ADRS-OTELF1 = T_ADRS-CTELF1 .

T_ADRS-OCOUNTRY = T_ADRS-CCOUNTRY.

ELSE.

SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR

INTO (T_ADRS-CNAME1, T_ADRS-CNAME2, T_ADRS-CSTREET,

T_ADRS-CCITY, T_ADRS-CPCODE, T_ADRS-CREGIO,

T_ADRS-CTELF1, KNA1-ADRNR)

FROM KNA1

WHERE KUNNR = LIKP-KUNNR.

SELECT SINGLE COUNTRY INTO ADRC-COUNTRY

FROM ADRC

WHERE ADDRNUMBER EQ KNA1-ADRNR.

SELECT SINGLE LANDX

INTO T_ADRS-CCOUNTRY

FROM T005T

WHERE SPRAS = 'EN'

AND LAND1 = ADRC-COUNTRY.

*Buyer Other than Consignee

SELECT SINGLE NAME1 NAME2 STRAS ORT01 PSTLZ REGIO TELF1 ADRNR

INTO (T_ADRS-ONAME1, T_ADRS-ONAME2, T_ADRS-OSTREET,

T_ADRS-OCITY, T_ADRS-OPCODE, T_ADRS-OREGIO,

T_ADRS-OTELF1, KNA1-ADRNR)

FROM KNA1

WHERE KUNNR = LIKP-KUNAG.

SELECT SINGLE COUNTRY INTO ADRC-COUNTRY

FROM ADRC

WHERE ADDRNUMBER EQ KNA1-ADRNR.

SELECT SINGLE LANDX

INTO T_ADRS-OCOUNTRY

FROM T005T

WHERE SPRAS = 'EN'

AND LAND1 = ADRC-COUNTRY.

ENDIF.

*Other's Ref

TIDNO = 'Z071'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-OREF = mslines-tdline(25).

EXIT.

ENDLOOP.

*Buyer's Order No Ref

TIDNO = 'Z023'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-BUYER = mslines-tdline(25).

EXIT.

ENDLOOP.

*Exporter Ref

TIDNO = 'Z072'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-XPREF = mslines-tdline(25).

EXIT.

ENDLOOP.

*Pre-Carraige By

TIDNO = 'Z074'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-PCRG = mslines-tdline(25).

EXIT.

ENDLOOP.

*Place Of reciept by Pre-Carraige

TIDNO = 'Z073'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-PLPCRG = mslines-tdline(25).

EXIT.

ENDLOOP.

*Vessel/Flight No

TIDNO = 'Z075'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-VFNO = mslines-tdline(25).

EXIT.

ENDLOOP.

*Port Of Loading

TIDNO = 'Z077'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-PLOAD = mslines-tdline(25).

EXIT.

ENDLOOP.

*Port Of Discharge

TIDNO = 'Z076'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-PDISG = mslines-tdline(25).

EXIT.

ENDLOOP.

*Final Destination

TIDNO = 'Z070'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-FDEST = mslines-tdline(25).

EXIT.

ENDLOOP.

*Terms Of Delivery & Payment

TIDNO = 'Z080'.

TNAME = SSORD.

TOBJT = 'VBBK'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

T_ADRS-TERMS = mslines-tdline(50).

EXIT.

ENDLOOP.

  • APPEND T_ADRS.

*BODY SECTION FOR LINE ITEMS

SELECT POSNR KWMENG VRKME WAERK

INTO (VBAP-POSNR, VBAP-KWMENG, VBAP-VRKME, VBAP-WAERK)

FROM VBAP

WHERE VBELN = SSORD.

*Mark/Case No

TIDNO = '0002'.

CONCATENATE SSORD

VBAP-POSNR

INTO TNAME.

TOBJT = 'VBBP'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

WA_ITEM-MARKNO = mslines-tdline(40).

EXIT.

ENDLOOP.

*Packing Type

TIDNO = '0003'.

CONCATENATE SSORD

VBAP-POSNR

INTO TNAME.

TOBJT = 'VBBP'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

WA_ITEM-PACKTYP = mslines-tdline(40).

EXIT.

ENDLOOP.

*Goods Description

TIDNO = '0001'.

CONCATENATE SSORD

VBAP-POSNR

INTO TNAME.

TOBJT = 'VBBP'.

PERFORM FINDTEXT.

LOOP AT MSLINES.

WA_ITEM-PACKTYP = mslines-tdline(40).

EXIT.

ENDLOOP.

*Goods Quantity

WA_ITEM-QTY = VBAP-KWMENG.

WA_ITEM-VRKME = VBAP-VRKME.

*Goods Rate

SELECT SINGLE KNUMV INTO VBAK-KNUMV FROM VBAK WHERE VBELN = SSORD.

SELECT SINGLE KBETR WAERS

INTO (WA_ITEM-RATE, WA_ITEM-WAERS)

FROM KONV

WHERE KNUMV = VBAK-KNUMV

AND KPOSN = VBAP-POSNR

AND KSCHL = 'PR00'.

*Goods Amount

WA_ITEM-AMOUNT = WA_ITEM-QTY * WA_ITEM-RATE.

WA_ITEM-WAERK = VBAP-WAERK.

TOT = TOT + WA_ITEM-AMOUNT.

APPEND WA_ITEM TO T_ITEM.

ENDSELECT.

T_ADRS-TOT = TOT.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = TOT

CURRENCY = VBAP-WAERK

  • FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = WORD

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 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.

  • TEXT = WORD-WORD.

*

  • CONCATENATE TEXT

  • 'DECIMAL'

  • WORD-WORD

  • INTO TEXT

  • SEPARATED BY ' '.

T_ADRS-TOT_WORDS = WORD-WORD.

APPEND T_ADRS.

START-OF-SELECTION.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'Z_SD_REP_MULTI_PRINT'

  • 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.

P_LANGUAGE = 'EN'.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

EXPORTING

I_LANGUAGE = P_LANGUAGE

I_APPLICATION = 'SAPDEFAULT'

IMPORTING

E_DEVTYPE = P_E_DEVTYPE.

P_OUTPUT_OPTIONS-XSFCMODE = 'X'.

P_OUTPUT_OPTIONS-XSF = SPACE.

P_OUTPUT_OPTIONS-XDFCMODE = 'X'.

P_OUTPUT_OPTIONS-XDF = SPACE.

P_OUTPUT_OPTIONS-TDPRINTER = P_E_DEVTYPE.

P_OUTPUT_OPTIONS-TDDEST = 'LOCL'.

APPEND P_OUTPUT_OPTIONS.

P_CONTROL_PARAMETERS-NO_DIALOG = 'X'.

P_CONTROL_PARAMETERS-GETOTF = 'X'.

P_CONTROL_PARAMETERS-NO_CLOSE = SPACE.

APPEND P_CONTROL_PARAMETERS.

CALL FUNCTION FM_NAME

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = P_CONTROL_PARAMETERS

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = P_OUTPUT_OPTIONS

USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO

  • JOB_OUTPUT_OPTIONS =

TABLES

T_ADRS = T_ADRS

T_ITEM = T_ITEM

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.

  • P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

USE_OTF_MC_CMD = 'X'

  • ARCHIVE_INDEX =

IMPORTING

BIN_FILESIZE = P_BIN_FILESIZE

TABLES

OTF = P_JOB_OUTPUT_INFO-OTFDATA

DOCTAB_ARCHIVE = P_DOC

LINES = P_LINES

EXCEPTIONS

ERR_CONV_NOT_POSSIBLE = 1

ERR_OTF_MC_NOENDMARKER = 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.

    • BREAK-POINT.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

BIN_FILESIZE = P_BIN_FILESIZE

  • CODEPAGE = ' '

FILENAME = 'C:\TEMP.PDF'

FILETYPE = 'BIN'

MODE = ''

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • COL_SELECT = ' '

  • COL_SELECTMASK = ' '

  • NO_AUTH_CHECK = ' '

IMPORTING

FILELENGTH = P_BIN_FILESIZE

TABLES

DATA_TAB = P_LINES

  • FIELDNAMES =

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_WRITE_ERROR = 2

  • INVALID_FILESIZE = 3

  • INVALID_TYPE = 4

  • NO_BATCH = 5

  • UNKNOWN_ERROR = 6

  • INVALID_TABLE_WIDTH = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • CUSTOMER_ERROR = 9

  • NO_AUTHORITY = 10

  • OTHERS = 11

.

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 'GUI_DOWNLOAD'

  • EXPORTING

  • BIN_FILESIZE = P_BIN_FILESIZE

  • FILENAME = 'C:\Documents and Settings\pvipin\Desktop\sd.pdf'

  • FILETYPE = 'BIN'

    • APPEND = ' '

    • WRITE_FIELD_SEPARATOR = ' '

    • HEADER = '00'

    • TRUNC_TRAILING_BLANKS = ' '

    • WRITE_LF = 'X'

    • COL_SELECT = ' '

    • COL_SELECT_MASK = ' '

    • DAT_MODE = ' '

    • CONFIRM_OVERWRITE = ' '

    • NO_AUTH_CHECK = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • WRITE_BOM = ' '

    • TRUNC_TRAILING_BLANKS_EOL = 'X'

    • IMPORTING

    • FILELENGTH =

*TABLES

  • DATA_TAB = P_LINES.

    • FIELDNAMES =

**EXCEPTIONS

    • FILE_WRITE_ERROR = 1

    • NO_BATCH = 2

    • GUI_REFUSE_FILETRANSFER = 3

    • INVALID_TYPE = 4

    • NO_AUTHORITY = 5

    • UNKNOWN_ERROR = 6

    • HEADER_NOT_ALLOWED = 7

    • SEPARATOR_NOT_ALLOWED = 8

    • FILESIZE_NOT_ALLOWED = 9

    • HEADER_TOO_LONG = 10

    • DP_ERROR_CREATE = 11

    • DP_ERROR_SEND = 12

    • DP_ERROR_WRITE = 13

    • UNKNOWN_DP_ERROR = 14

    • ACCESS_DENIED = 15

    • DP_OUT_OF_MEMORY = 16

    • DISK_FULL = 17

    • DP_TIMEOUT = 18

    • FILE_NOT_FOUND = 19

    • DATAPROVIDER_EXCEPTION = 20

    • CONTROL_FLUSH_ERROR = 21

    • OTHERS = 22 .

**

    • IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    • ENDIF.

&----


*& Form FINDTEXT

&----


  • text

----


FORM FINDTEXT.

REFRESH mslines.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = tidno

language = sy-langu

name = tname

object = tobjt

TABLES

lines = mslines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

DELETE mslines WHERE tdline IS INITIAL.

ENDFORM. "FINDTEXTThnx in Advnce

Moni

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

1 ACCEPTED SOLUTION

former_member214131
Active Contributor
0 Kudos

Hello,

Plz uncomment 'IMPORTING' in the FM

<b>* IMPORTING</b>

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

JOB_OUTPUT_OPTIONS = P_JOB_OUTPUT_INFO

I hope this helps you.

Regards, Murugesh AS

21 REPLIES 21

former_member214131
Active Contributor
0 Kudos

Hello,

Plz uncomment 'IMPORTING' in the FM

<b>* IMPORTING</b>

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

JOB_OUTPUT_OPTIONS = P_JOB_OUTPUT_INFO

I hope this helps you.

Regards, Murugesh AS

former_member214131
Active Contributor
0 Kudos

Hello,

Do you still have problem??

Regds, Murugesh AS

0 Kudos

yes Murugesh

It's throwing this error

Error analysis

An exception occurred. This exception will be dealt with in more detail

below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught, which

led to a runtime error. The reason for this exception is:

The call to the function module "/1BCDWB/SF00000032" is incorrect:

The function module interface allows you to specify only fields

of a particular type under "JOB_OUTPUT_OPTIONS". The field "P_JOB_OUTPUT_INFO"

specified here

has a different field type.

Plz help

0 Kudos

Hello,

Try this:

Data: P_JOB_OUTPUT_INFO type ssfcrescl occurs 0 with header line.

Let me know if the problem persist.

Regards, Murugesh AS

PS.: Please uncomment all "exceptions" in any FM you call in your program to catch the right exception. This also avoids the ABAP Short Dump.

Message was edited by: Murugesh Arcot

0 Kudos

STILL HAV SAME PROBLEM , PLZ HELP

0 Kudos

Hello,

I think you are passing wrong parameter to the FM

JOB_OUTPUT_OPTIONS = P_JOB_OUTPUT_INFO

Instead it should be

job_output_info = P_JOB_OUTPUT_INFO

Let me know if this solves your problem.

Regds, Murugesh AS

0 Kudos

Dear Murugesh

Many Thnx for correcting my silly overlooked mistakes .

Its fine but it raises one exception telling that "File Not Found in GUI_Download Fm"

Do i need to 2 create this "sd.pdf" , in my system Acrobat Reader is installed , it wont allow to create a new PDF file .

Thnx

Moni

0 Kudos

Hello,

I have used FM 'CONVERT_OTF_2_PDF' in my programs to convert OTF to PDF. Please find the sample code:

call function 'CONVERT_OTF_2_PDF'

exporting

use_otf_mc_cmd = 'X'

tables

otf = l_t_job_output-otfdata

doctab_archive = l_t_docs

lines = pdfdata_tab

exceptions

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

others = 3.

Once this conversion is successful, you need to download the data either by WS_DOWNLOAD or GUI_DOWNLOAD to a location in presentation server by a proper name viz., C:\TMP\TEST.PDF.

If you want to view the doc, use FM 'WS_EXECUTE' or 'GUI_EXEC'.

Regards, Murugesh AS

0 Kudos

Hi

1)it still gives the error "File not found "

Is it because "sales.pdf" has to be created in advance

in the system .i have Acrobat reader for reading purpose only , not 4 creating new PDF file (it wont allow to create new PDF file )

Throw some light on this ,plz

2)I need to get 4 different Forms (Export Invoice, Packing List,Encloser 2 packing list & Case Marking ) by executing a single print program .

Do i create separate Forms and call FMs generated by each Forms , in my print program

Or create "First , Second .... pages within the same Form name "

Plz guide

Thx

Message was edited by: md monirujjaman

0 Kudos

Hello,

DATA : l_t_docs LIKE docs OCCURS 0 WITH HEADER LINE.

you may ignore this parameter if you do not need it in you program.

-Murugesh AS

0 Kudos

Hello,

The FM CONVERT_OTF_2_PDF will convert the Form output to the PDF format. So you need only acrobat reader to view the document output.

While testing, I would rather close the Acrobat reader and start working.

For the second question,

You need to create 4 different SSFs to meet your reqmt. Then each one of them is called serially, the output is then converted into PDF with different names, and then viewed one by one if reqd.

I hope this will help you.

Regards, Murugesh AS

0 Kudos

Hi

Now this is the error" CONVT_NO_NUMBER"

The termination occurred in the ABAP program "SAPLSTXW " in "CONVERT_OTF".

The main program was "ZSD_REP_MULTI_PRINT ".

The termination occurred in line 103 of the source code of the (Include)

program "LSTXWU06 "

of the source code of program "LSTXWU06 " (when calling the editor 1030).

Plz help

Thnx

Moni

0 Kudos

Hello,

Plz try with FM 'CONVERT_OTF_2_PDF'. The sample code is given already.

before you call the above FM check whether the OTF tab is filled with data.

Regards, Murugesh AS

0 Kudos

i HAV UPDATED THE CODE SECTION PLZ CHECK ONCE

I HAV USED "CONVERT_OTF_2_PDF" but SAME PROBLEM

pLZ HELP

Message was edited by: md monirujjaman

0 Kudos

Hello,

I think the following statement is causing problem.

P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.

either give:

P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA[].

or

directly pass P_JOB_OUTPUT_INFO-OTFDATA into FM parameter.

This is because you are filling only header into P_OTF and NOT the Contents of internal table by the statement

P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.

let me know whether it works.

Regards, Murugesh AS

have alook at this thread:

this may help you

Message was edited by: Murugesh Arcot

Message was edited by: Murugesh Arcot

0 Kudos

Dear murugesh

P_OTF[] is getting populated with the right values 7 has no problem , CONVERT_OTF_2_PDF is giving problem.

Thnx

Message was edited by: md monirujjaman

0 Kudos

Hello,

Try to pass all parameters to the FM like

DATA : filesize TYPE i.

DATA : l_t_job_output TYPE ssfcrescl OCCURS 0 WITH HEADER LINE.

DATA : l_t_docs LIKE docs OCCURS 0 WITH HEADER LINE.

DATA : pdfdata_tab LIKE tline OCCURS 200.

CALL FUNCTION 'CONVERT_OTF_2_PDF'

EXPORTING

use_otf_mc_cmd = 'X'

IMPORTING

bin_filesize = filesize

TABLES

otf = l_t_job_output-otfdata

doctab_archive = l_t_docs

lines = pdfdata_tab

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

OTHERS = 3.

If this still gives you a dump check out in OSS whether any note is to be applied on the FM.

Regards, Murugesh AS

0 Kudos

Dear Murugesh

I hav pasted the updated code plz look into this , no syntax error , no symantic error & got stuck ,plz help

I have strictly followed ur code , but still i am getting this error " CONVT_NO_NUMBER"

The termination occurred in the ABAP program "SAPLSTXW " in "CONVERT_OTF".

The main program was "ZSD_REP_MULTI_PRINT ".

The termination occurred in line 103 of the source code of the (Include)

program "LSTXWU06 "

of the source code of program "LSTXWU06 " (when calling the editor 1030).

Message was edited by: md monirujjaman

Message was edited by: md monirujjaman

0 Kudos

Hello,

Please check in OSS by giving either the FM name or the error code and check for a note. I think there is some problem in the FM. BTW on which SAP version you are working??

As of now I do not have any OSS ID and hence I could not check up.

Regards,

Murugesh AS

0 Kudos

Thanx a lot Murugesh

Have great time , i solved it somehow by using "WS_DOWNLOAD" , actually i was using "GUI_DOWNLOAD"

which was not compatible 7 giving error .

I have updated the latest code in this post

Moni

Former Member
0 Kudos

Check out transaction SMARTSTYLE(S), create a smartstyle element such as paragraph, character etc... While creating the SMARTFORM, you need to specify the name of the SMARTSTYLE you intend to use. All the elements for that particular SMARTSTYLE are then visible while creating a text element.

Request you to check help.sap.com for more information on Smartforms.

Regards,

Subramanian V.