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: 

alv grid - call transaction 'ME22N' and reflect the change made in alv grid

Former Member
0 Kudos

Hi,

<u>Scenario</u>

I have an alv list which has fields Purchase document no. (EBELN) and Item delivery date (EINDT). EBELN field is hot spot enabled. when i click on that transaction 'ME22' is called. I have done this using USER_COMMAND subroutine.the code is given.

----


  • FORM USER_COMMAND *

----


  • ........ *

----


  • Call transaction ME22N on clicking Document number *

----


FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM

I_SELFIELD TYPE SLIS_SELFIELD.

DATA: F_SUBRC LIKE SY-SUBRC,

s_arseg like G_T_PORD. "the internal table used is G_T_PORD

CASE F_UCOMM.

WHEN '&IC1'.

IF i_selfield-fieldname = 'EBELN'.

READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.

SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.

CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

endform.

<u>Requirement</u>

After calling the transaction, If the user changes the Item delivery date (EINDT) at the ME22 transaction screen, the new date needs to be reflected in the ALV grid.

Plz help it is very urgent.

5 REPLIES 5

former_member632991
Active Contributor
0 Kudos

Hi,

<b>use selfield-refresh = 'X'.</b> after

WHEN '&IC1'.

IF i_selfield-fieldname = 'EBELN'.

READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.

SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.

CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

<b>Also chech the method REFRESH_TABLE_DISPLAY</b>

Example:

CALL METHOD go_grid->refresh_table_display.

check the link,

http://www.sap-img.com/abap/how-to-refresh-alv-list-grid-once-it-is-displayed.htm

Regards,

Sonika

0 Kudos

The first method (using selfield-refresh = 'X'.) didn't work as the internal table doesnt get modified when the user make changes in Item delivery date(EINDT) at ME22 transaction screen. The 2nd method is OO,which can't be used in my case.

I tried calling the subroutine for populating the itab (G_T_PORD) and the subroutine for displaying the alv grid immediately after calling ME22N transaction. Still it is not reflecting the new date in the output alv. The code is given below.

----


  • FORM USER_COMMAND *

----


  • ........ *

----


  • Call transaction ME22N on clicking Document number *

----


FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM

I_SELFIELD TYPE SLIS_SELFIELD.

DATA: F_SUBRC LIKE SY-SUBRC,

s_arseg like G_T_PORD.

CASE F_UCOMM.

WHEN '&IC1'.

IF i_selfield-fieldname = 'EBELN'.

READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.

SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.

CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

refresh G_T_PORD.

perform F1000_POPULATE_PO.

perform F2000_DISPLAY_PO .

endform.

0 Kudos

Hi,

Give a WAIT 2 seconds , command after call transaction and then call REFRESH ALV. This command would help only if you are doing some database updates.

Also try this

CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.

<b>RS_SELFIELD-exit = 'X'.</b>

Check this link

Regards,

Sonika

0 Kudos

Hi,

It is working fine. But now it is consuming a lot of time to display the list.

Is there any way to modify the internal table (G_T_PORD) with the new date other than calling perform F1000_POPULATE_PO again.

thanks,

nobin.

0 Kudos

Check on other links on SDN for this issue.