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: 

i want to send an internal table with html mail.

Former Member
0 Kudos

hi,

i created a fm. and i want to give an internal table to imports value. then i want to send this internal table with html mail. but how can i give internal table to fm. because data type is unknown. it can changes. please help me.

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

I had some extra time so here it is .

global-y_r_eitan_tests_05.txt - This go to the gloabl (support class)

y_r_eitan_tests_05.txt - The function - generate html table and send by using cl_bcs .

Using:

FORM test_07 .

  DATA: it_sflight TYPE TABLE OF  sflight .

  SELECT * INTO TABLE it_sflight

  FROM sflight

  UP TO 100 ROWS .

  DATA: it_receivers TYPE somlreci1_t .

  APPEND '<receiver mail>' TO it_receivers .

  CALL FUNCTION 'Y_R_EITAN_TESTS_05'

    EXPORTING

      i_subject    = 'Hi there'

      it_receivers = it_receivers

      it_data      = it_sflight.

ENDFORM .                                                   "test_07

Regards.

11 REPLIES 11

ipravir
Active Contributor
0 Kudos

Hi Burak,

Can you provide bit more information about your requirement?

Is the FM should work with all type of Internal Table?

Regrads.

Praveer.

Former Member
0 Kudos

hi praveer,

yes fm should work all type of internal table. because we cant know. which internal tables need

regards.

ipravir
Active Contributor
0 Kudos

This message was moderated.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

You can use parameter type table .

You can use cl_salv_ddic=>get_by_data to find out the structure of the table .

regards.    

FUNCTION y_r_eitan_tests_05 .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IT_DATA) TYPE  TABLE
*"----------------------------------------------------------------------

   DATA: it_ddfields TYPE ddfields .
   FIELD-SYMBOLS: <st_ddfields> LIKE LINE OF it_ddfields .

* Get DDIC Information
   CALL METHOD cl_salv_ddic=>get_by_data
     EXPORTING
       data    = it_data
     RECEIVING
       t_dfies = it_ddfields.

ENDFUNCTION.


See http://scn.sap.com/message/14309154#14309154

In program y_r_eitan_test_10_02

FORM mail_1_prep_2 the use of cl_salv_ddic=>get_by_data to generate html table .

0 Kudos

hi again, thanks a lot. i did it. but fm is not working when i added it_data in import. then i want to execute but it says;

Error generating the test frame

regards,

burak

0 Kudos

Hi,

Please upload the program mention and study "FORM mail_1_prep_2"

The program sends many types of attachments.

"error generating the test frame"

You cannot test this function using se37 .

Write a program that send a table to the function.

Regards.

thangam_perumal
Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

I had some extra time so here it is .

global-y_r_eitan_tests_05.txt - This go to the gloabl (support class)

y_r_eitan_tests_05.txt - The function - generate html table and send by using cl_bcs .

Using:

FORM test_07 .

  DATA: it_sflight TYPE TABLE OF  sflight .

  SELECT * INTO TABLE it_sflight

  FROM sflight

  UP TO 100 ROWS .

  DATA: it_receivers TYPE somlreci1_t .

  APPEND '<receiver mail>' TO it_receivers .

  CALL FUNCTION 'Y_R_EITAN_TESTS_05'

    EXPORTING

      i_subject    = 'Hi there'

      it_receivers = it_receivers

      it_data      = it_sflight.

ENDFORM .                                                   "test_07

Regards.

0 Kudos

you are great, thanks a lot Eitan.

best regards.

Burak

0 Kudos

Hi,

You are welcome .

It was fun.

Regards.