Application Development and Automation 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: 
Read only

ALV report to smartforms

hossain_rajib55
Participant
0 Likes
3,286

Hello !!

I am creating a ALV report now need to print it,so i create another smartforms . Now i want to call it from ALV report when print button is pressed. Please help me.

Hello !!

I am creating a ALV report now need to print it,so i create another smartforms . Now i want to call it from ALV report when print button is pressed. Please help me.

10 REPLIES 10
Read only

Sandra_Rossi
Active Contributor
2,497

Search the web "ALV report to smartforms"

Read only

former_member557605
Participant
0 Likes
2,497

Hi,

Create one TABLE in smart form interface. Table should be the same table type (Same table type which you are getting from ALV).

Follow the link Click Here.. . I hope, It will be help full for you.

Regards,

Rupesh

Read only

0 Likes
2,497

Thanks..trying

Read only

0 Likes
2,497

Try this code:

DATA: l_funcion              TYPE rs38l_fnam.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname           = 'Name of Smartforms’

    IMPORTING

      fm_name            = l_funcion

    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.

  IF sy-subrc = 0.

      CALL FUNCTION l_funcion

        EXCEPTIONS

          formatting_error       = 1

          internal_error         = 2

          send_error             = 3

          user_canceled          = 4

          OTHERS                 = 5.

ENDIF.

Good Luck!

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,497

Steps

  • Create the smartforms with the required interface (could be output table and field catalog even sort, filter and layout information can be required)
  • Depending on the ALV tool (class, old REUSE) handle the standard function code for print event (Usually deactivation if standard function and adding your own is much easier, else search for 'override ALV standard function')

For more information, you should provide more information on how you built the ALV (tool) and which format you exepct for the generated spool.

Read only

0 Likes
2,497

I am adding a button and call pf_status. But it's not work. I'm sharing my code in the below ,if possible provide me the correct one.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = 'SUB_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '

TABLES
t_outtab = lt_fgfinal
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

form sub_pf_status using RT_EXTAB TYPE slis_t_extab.
set PF-STATUS 'ZMM_PFSTATUS'.
ENDFORM.

form user_command USING r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
if r_ucomm eq '&PRINT'.
MESSAGE ' Print Button is pressed' type 'S'.
ENDIF.
ENDFORM.

Read only

0 Likes
2,497

what do you mean "not work", what do you experience, what do you expect?

Read only

0 Likes
2,497

Could you pass your program name (don't use sy-repid, create a local variable) in parameter I_CALLBACK_PROGRAM so your forms will be called (and read the good old FM documentaiton).

Could you also consider using more up-to-date tools such as SALV grid classes?

Read only

0 Likes
2,497

Hello Sandra!!

Not work mean its not come in the Application toolbar. Actually I want to add a button, after pressing this smartforms is open.That's it.

Thanks for your co-operation.

Read only

0 Likes
2,497
Rajib Hossain If you use the debug, I guess it doesn't even go to your subroutine SUB_PF_STATUS hence it's logical that the button is not displayed. Cf Raymond's comment about filling the parameter I_CALLBACK_PROGRAM.