Category Archive How to

Change Adobe form output format : Portrait or landscape

Search tag: mode, orientation, paysage

Edit Print message

Use transaction: NACE
For PP, use transaction: OPK8


Search tag: nast, impression

How to find exit enhancement/extension name from FM name

Check table : MODSAP.

For example, to get enhancement (extention in french) of EXIT_SAPLV56K_002 ,
enter with Enhancement (field MEMBER) =  EXIT_SAPLV56K_002, you will get in field NAME the enhancement name : V56K0001.

Scripting language for Adobe forms

Check this post : https://blogs.sap.com/2015/07/15/overview-on-scripting-languages-for-adobe-forms-beginners/.

Hide field if empty

Using javascript :


//data.Main.HEADER.ADRESSE_CLIENT.NAME3::initialize - (JavaScript, client)

if(this.rawValue == "" || this.rawValue == null) {
    this.presence = "hidden";
}

  • “hidden” will hide the whole element and shift lower elements up.
  • “invisible” will hide only the TEXT INSIDE the element NOT the element itself (no shifting of other elements).
Read More

Submit a program in background via job

The submited program with method below can be monitored in SM37.


    DATA: lv_number           TYPE tbtcjob-jobcount,
          lv_name             TYPE tbtcjob-jobname.

    lv_name =  'Relevant Job name'.

    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = lv_name
      IMPORTING
        jobcount         = lv_number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.

    IF sy-subrc = 0.
      SUBMIT z_report_to_call  WITH p_par1    = lv_param1
                               WITH p_par2    = lv_par2
                               WITH s_matnr  IN lr_matnr
                               WITH p_flag    = 'X'
                               VIA JOB lv_name NUMBER lv_number
                               AND RETURN.

      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = lv_number
            jobname              = lv_name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc > 1.
          MESSAGE i054(s_cus_img_activity).
          " Background job could not be started.
          " Le job d’arrière-plan n’a pas pu être lancé.
        ENDIF.

      ELSE.
        " Display error returned by SUBMIT of program
        DATA(ls_msg) = cl_abap_submit_handling=>get_error_message( ).
        MESSAGE ID ls_msg-msgid
                TYPE 'I'
                NUMBER ls_msg-msgno
                WITH ls_msg-msgv1 ls_msg-msgv2 ls_msg-msgv3 ls_msg-msgv4
                DISPLAY LIKE ls_msg-msgty.
      ENDIF.
    ENDIF.

Merge PDF files with ABAP

If you want to merge PDF files on SAP server, you will need a third party software installed on SAP Server.
Here is one solution with PDF ToolKit :

Read More