2021 Sep 28 8:37 AM
I have 3 forms and I return lt return in these forms.
DATA: lt_return TYPE TABLE OF bapiret2,
ls_return TYPE bapiret2.
What I need to do is to check these forms and send an e-mail if their type is 'E', 'A' and 'I'.
I created my mail form and these 3 forms that I mentioned, and there is no problem with them. Now, I need to check the types of these 3 forms I created with lt_return and if it is wrong, I need to call my send_mail form and send an error mail.
2021 Sep 28 9:30 AM
How far have you been able to advance, have you already
Where exactly are you stuck?
2021 Sep 28 9:42 AM
I created my mail form and these 3 forms that I mentioned, and there is no problem with them. Now, I need to check the types of these 3 forms I created with lt_return and if it is wrong, I need to call my send_mail form and send an error mail.
FORM x_x .
DATA: lt_return TYPE TABLE OF bapiret2,
ls_return TYPE bapiret2.
LOOP AT lt_return INTO DATA(ls_error).
IF ls_error-type EQ 'E'.
PERFORM send_mail.
ENDIF.
ENDLOOP.
ENDFORM.
2021 Sep 28 10:38 AM
2021 Sep 28 11:02 AM
2021 Sep 28 2:05 PM
Something like this:
DATA: it_bapiret2 TYPE bapiret2_t.
PERFORM x_x USING it_bapiret2.
FORM x_x USING p_bapiret2 TYPE bapiret2_t.
LOOP AT p_bapiret2 ASSIGNING FIELD-SYMBOL(<fs_bapiret2>).
IF <fs_bapiret2>-type EQ 'E'.
PERFORM send_mail.
ENDIF.
ENDLOOP.
ENDFORM.
2021 Sep 28 3:59 PM
TYPES: ty_bapiret2_tab TYPE TABLE OF bapiret2.
DATA: lt_return TYPE ty_bapiret2_tab,
ls_return TYPE bapiret2.
PERFORM x USING lt_return.
FORM x USING it_return TYPE ty_bapiret2_tab.
ENDFORM.
2021 Sep 28 4:34 PM
Hi sahbaz,
you can splitt it_return into three different tables:
DATA: lt_return TYPE bapiret2_t,
ls_return TYPE bapiret2.
data(lt_return_i) = value bapiret2_t( for l_line in lt_return where ( type = 'I') ( l_line ) ).
data(lt_return_a) = value bapiret2_t( for l_line in lt_return where ( type = 'A') ( l_line ) ).
data(lt_return_e) = value bapiret2_t( for l_line in lt_return where ( type = 'E') ( l_line ) ).