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: 

Purchase Order Z smartform archival

Former Member
0 Kudos

Hi Experts,

Please let me know the initial set up and parameters to be passed to smartforms, so that i could archive the form generated?

I have no idea on how archiving is done.

Thanks in Advance,

Regards,

Sunil

1 ACCEPTED SOLUTION

romit_raina
Active Participant
0 Kudos

Hello Sunil,

Below parameters need to be filled :-

Pass values to the following parameters while calling smart form in the Z program:

ARCHIVE_INDEX

ARCHIVE_INDEX_TAB

ARCHIVE_PARAMETERS

CONTROL_PARAMETERS

Check below code for reference:

    l_control_param-device = ld_device.

    l_control_param-no_dialog = 'X'.

    l_control_param-preview = xscreen.

    l_control_param-getotf = getotf.

    l_control_param-langu = nast-spras.

CALL FUNCTION lf_fm_name

      EXPORTING

        archive_index = toa_dara

        archive_parameters = arc_params

        control_parameters = ls_control_param

Also please go through the below link :

          https://scn.sap.com/thread/1279622

Hope this will help you .

Thanks

Romit Raina

4 REPLIES 4

Former Member
0 Kudos

Thank You Resolved!!!!!

Define content repositories in transaction SPRO (sap netweaver->application server->basis service->archive link->basic customising)

Define document type.

Then create links using ( edit links under the same), here define the business object type, document type, CP)

Now use the function module  ARCHIV_CREATE_OUTGOINGDOCUMENT

to archive.

In the smartform parameters make sure the below is done

  control_parameters

-getotf = abap_true.
control_parameters
-no_dialog = 'X'.
control_parameters
-preview = 'X'.

romit_raina
Active Participant
0 Kudos

Hello Sunil,

Below parameters need to be filled :-

Pass values to the following parameters while calling smart form in the Z program:

ARCHIVE_INDEX

ARCHIVE_INDEX_TAB

ARCHIVE_PARAMETERS

CONTROL_PARAMETERS

Check below code for reference:

    l_control_param-device = ld_device.

    l_control_param-no_dialog = 'X'.

    l_control_param-preview = xscreen.

    l_control_param-getotf = getotf.

    l_control_param-langu = nast-spras.

CALL FUNCTION lf_fm_name

      EXPORTING

        archive_index = toa_dara

        archive_parameters = arc_params

        control_parameters = ls_control_param

Also please go through the below link :

          https://scn.sap.com/thread/1279622

Hope this will help you .

Thanks

Romit Raina

0 Kudos

Thanks Romit,

Since i wanted to archive in PDF format, i have converted the otf format from smartform output to pdf using FM SX_OBJECT_CONVERT_OTF_PDF, then to Xstring using FM SCMS_BINARY_TO_XSTRING. After this i used the FM ARCHIV_CREATE_OUTGOINGDOCUMENT, passing the archive parameter, THIS worked.

  .

0 Kudos

Great Sunil.

If you have got your objective, can you please mark this thread as completed.

It would be good if we closed this thread.

Thanks Again!!!

Romit Raina