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: 

Update custom fields in tables QMEL, QMFE and QMSM through bapi BAPI_ALM_NOTIF_CREATE

0 Kudos

Hi All,

I have added a set of custom fields in tables QMEL, QMFE and QMSM.

My requirement is that, i have to update the custom fields as well in addition to the standard fields through the BAPI BAPI_ALM_NOTIF_CREATE.

http://scn.sap.com/docs/DOC-50104

I went through the above link which explains about updating customer Fields in BAPIs which doesn't have Extension Structure.

But i dont understand how the function exit is related to the BAPI.

Besides i even tried checking if the function exit gets triggered when the BAPI is being executed. But it didnt get triggered.

Appreciate your help in identifying a solution.

Thanks in advance.

Regards,

Vignesh Sunkasi.K

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

You will only know if the customer function exit is triggered after you activate it. If it's triggered in background (update task) you will know only if the exit does something you can see the results.

Create the exit include, put in code

WHILE 1 = 1.

ENDWHILE.

Then activate it, activate the CMOD project. Try and see in SM50 process overview if you can see the process in endless loop. Use debugger to exit.

Regards

Clemens

5 REPLIES 5

Clemenss
Active Contributor
0 Kudos

You will only know if the customer function exit is triggered after you activate it. If it's triggered in background (update task) you will know only if the exit does something you can see the results.

Create the exit include, put in code

WHILE 1 = 1.

ENDWHILE.

Then activate it, activate the CMOD project. Try and see in SM50 process overview if you can see the process in endless loop. Use debugger to exit.

Regards

Clemens

0 Kudos

Hi Clemens,

Thanks for your reply. Now i am able to add custom filed details with the help of the above mentioned exit.

Now i have to create another RFC to modify the existing notification details.

I am using bapi BAPI_ALM_NOTIF_DATA_MODIFY to modify the notification details.

But again the problem rises to update the custom fields.

I tried searching for exits and BADIs but nothing seemed to work.

Can you give your inputs on how it could be achieved.

Thanks in advance.

Regards,

Vignesh Sunkasi.K

pablos81
Explorer
0 Kudos

Use IQS4_MODIFY_NOTIFICATION and append your CI_QMEL Z fields into the structure "riqs5"

CALL FUNCTION 'IQS4_MODIFY_NOTIFICATION'
      EXPORTING
        i_qmnum                      = qmnum
        i_riqs5_new                  = ls_riqs5
*       I_CONV                       = ' '
*       I_POST                       = 'X'
*       I_COMMIT                     = ' '
*       I_WAIT                       = ' '
*       I_REFRESH_COMPLETE           = 'X'
*       P_HEAD_NOCHANGE              =
*       I_NO_BUFFER_REFRESH_ON_ERROR = ' '
*      IMPORTING
*       E_VIQMEL_OLD                 =
*        e_viqmel_new                 = 
      TABLES
*       I_VIQMFE_T                   = 
*       I_VIQMUR_T                   = 
*       I_VIQMSM_T                   = 
*       I_VIQMMA_T                   = 
*       I_IHPA_T                     = 
        return                       = 
*       I_INLINES_T                  = 
      .
  ENDIF .

0 Kudos

Hello Vignesh,

Please can you explain me how you solved your problem? I'm in the same situation than you.

I created a custom field in QMEL and now I want to fill in it with BAPI_ALM_NOTIF_CREATE.

1) I update the structure BAPI_TE_QMEL with an append (like below)

But it doesn't work

Thanks in advance

Regards

Cygnus

0 Kudos

U can use this code example for update the customs field on QMEL:


*&---------------------------------------------------------------------*

*& Report ztest_qmel_change_data
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ztest_qmel_change_data.
TABLES: qmel.

PARAMETERS: lv_qmnum type qmnum.

DATA:
lt_return TYPE bapiret2_t,
ls_viqmel TYPE viqmel.


CALL FUNCTION 'IQS4_GET_NOTIFICATION'
EXPORTING
i_qmnum = lv_qmnum

IMPORTING
e_viqmel = ls_viqmel
* E_RIWO00 =
* E_RIWO03 =
* E_TQ80 =
TABLES
* E_IVIQMFE_T =
* E_IVIQMMA_T =
* E_IVIQMSM_T =
* E_IVIQMUR_T =
* E_INLINES_T =
* E_IHPAVB_T =
return = lt_return.

IF lt_return IS NOT INITIAL. "Meldung nicht gefunden
* READ TABLE lt_return INTO rs_return INDEX 1.
* RETURN. " raus hier
ENDIF.
DATA ms_riqs5 TYPE riqs5 .
MOVE-CORRESPONDING ls_viqmel TO ms_riqs5.

"Z-FIELDS Examples

ms_riqs5-zz_qmnum_03 = '8000003956' .
ms_riqs5-zz_qmnum_80 = '456512452'.
ms_riqs5-zz_schaetzkost = '456'.

CALL FUNCTION 'IQS4_MODIFY_NOTIFICATION'
EXPORTING
i_qmnum = lv_qmnum

i_riqs5_new = ms_riqs5
* I_CONV = ' '
i_post = 'X'
i_commit = 'X'
* I_WAIT = ' '
* I_REFRESH_COMPLETE = 'X'
* P_HEAD_NOCHANGE =
* I_NO_BUFFER_REFRESH_ON_ERROR = ' '
* IMPORTING
* E_VIQMEL_OLD =
* E_VIQMEL_NEW =
TABLES
* I_VIQMFE_T =
* I_VIQMUR_T =
* I_VIQMSM_T =
* I_VIQMMA_T =
* I_IHPA_T =
return = lt_return.
* i_inlines_t =.

cl_demo_output=>display( lt_return ).