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

Refresh report

Former Member
0 Likes
1,106

hi experts,

I have developed courier detail report,when i double click on sales order no it goes to courier detail transaction.if i want to any modification i do on that,till here it's working fine but if i went back to my report it's not instently refreshed. the updated data will show when i execute report next time,so please help me for this prob.

this is my code for report-


CASE r_ucomm.
    WHEN '&IC1'.
      CLEAR : lv_vbeln,lv_kunnr.
      READ TABLE gt_list INTO gs_list INDEX rs_selfield-tabindex.
      lv_vbeln = gs_list-vbeln.
      lv_erdat = gs_list-erdat.
      lv_courier_no = gs_list-courier_no.
      lv_courier_cnts = gs_list-courier_cnts.
      lv_othr_cnts = gs_list-othr_cnts.
      CLEAR gs_list.
      IF rs_selfield-fieldname = 'VBELN'.
        REFRESH : it_bdc.
        DATA: spa_tab TYPE STANDARD TABLE OF rfc_spagpa WITH HEADER LINE.
        PERFORM bdc_dynpro      USING 'ZMCM_SD034B_COURIER' '0100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTE'.
        PERFORM bdc_field       USING 'ZCOURIER-VBELN'
                                      lv_vbeln.
        PERFORM bdc_field       USING 'ZCOURIER-ERDAT'
                                      lv_erdat.
        PERFORM bdc_field       USING 'ZCOURIER-COURIER_CNTS'
                                      lv_courier_cnts.
        PERFORM bdc_field       USING 'ZCOURIER-OTHR_CNTS'
                                      lv_othr_cnts.
        PERFORM bdc_field       USING 'ZCOURIER-COURIER_NO'
                                      lv_courier_no.
        CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
          EXPORTING
            tcode                         = 'ZSD13B'
           mode_val                       = 'E'
           update_val                     = 'A'
           TABLES
             using_tab                     = it_bdc
             spagpa_tab                    = spa_tab
           EXCEPTIONS
             call_transaction_denied       = 1
             tcode_invalid                 = 2
             OTHERS                        = 3
                  .
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
  ENDCASE.

8 REPLIES 8
Read only

JoffyJohn
Active Contributor
0 Likes
1,064

You have to incorporate the logic for refreshing the data.

Then only the data will be refreshed on pressing back button.

Read only

Former Member
0 Likes
1,064

hi joffy,

can you please help me for logic to refresh report.and one thing, I'm using FM avl.

Read only

Former Member
0 Likes
1,064

Hi,

this is the user command event

FORM USERCOMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

case .

when 'VBELN'.

after the BDC update the changes in the ALV table .

endcase .

put RS_SELFIELD-REFRESH = 'X'. after the end case

Read only

Former Member
0 Likes
1,064

dear Madhukar,

please first i tell you my scenario.we have two transection one id for report & other is for module pool when i double click on vbeln of report then it trigar the module pool program where modification is done and then if click on save again it caome back to report program.

The problem is that report program is show without updated data. if i re-execute report then is show the updated record. i want when we press save in module pool then it back to report and report shows the updated data.

thanks & Regards

Read only

Former Member
0 Likes
1,064

Hi atulks,

wat i would suggest is in your AT LINE-SELECTION event clear the final ITAB and fill it again on back button and display.

so that u will get updated record....

Regards,

Gaurav.

Read only

Former Member
0 Likes
1,064

Atul

After returning from the MPP u can get the data from the table & that changed data u update in the report which u r displaying this one thing u can do or u can export the data which is changed from MPP & import it in report and modify the internal table & use the refresh logic

Read only

Former Member
0 Likes
1,064

Hi...

Use the below Code,it will work.

DATA LV_MSSG(80). "#EC NEEDED

  • Wait in a task

CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '0001'

PERFORMING F_TASK_END ON END OF TASK

EXPORTING

SECONDS = 180 " Refresh time

BUSY_WAITING = SPACE

EXCEPTIONS

RESOURCE_FAILURE = 1

COMMUNICATION_FAILURE = 2 MESSAGE LV_MSSG

SYSTEM_FAILURE = 3 MESSAGE LV_MSSG

OTHERS = 4.

FORM F_TASK_END USING U_TASKNAME.

DATA LV_MSSG(80). "#EC NEEDED*

*Receiving task results

RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'

EXCEPTIONS

RESOURCE_FAILURE = 1

COMMUNICATION_FAILURE = 2 MESSAGE LV_MSSG

SYSTEM_FAILURE = 3 MESSAGE LV_MSSG

OTHERS = 4.

CHECK SY-SUBRC EQ 0.

SET USER-COMMAND 'REFRESH'. " Refresh

ENDFORM. "f_task_end

Read only

Former Member
0 Likes
1,064

Answered