Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Displaying Records in Tabular Format in RF Screen

$
0
0

In The RF Programming Table Controls can not be created. But the following

Code can create virtual table where the user can navigate up and Down.

Due to Space restriction in RF, only some fields are visible at a time and

User can scroll vertically through the fields by pressing up and down button.

 

In Solectron scenario, only 4 fields are visible at a time.

 

 

STEP 1: Create the layout for Virtual Table by arranging I/O Box.

  Make all scrollable true to scroll each field horizontally.

1.JPG

 

2.JPG

 

STEP 2: Get the Data to be displayed in internal table i.e itab_mpn_detail.

 

STEP 3: Show first four records of an internal table in tabular format when the screen is displayed for the First time which will be called at the PBO of screen.

 

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

*&      Form sub_init_MPN

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

*      Show Manufacturing Part No in tabular format PBO of 9600

*----------------------------------------------------------------------*

FORM sub_init_mpn

 

Data : l_step type i.

 

*Show 4 records at a time in tabular format

 

        LOOP AT itab_mpn_detail INTO wa_mpn_detail.

 

*Compare with the counter variable

          IF l_step EQ cnt_track.

 

            EXIT.

          ELSE.

 

*Otherwise increase the counter

            l_step = l_step + 1.

          ENDIF.

*assign it into screen variable to show in tabular format

 

          CASE l_step.

            WHEN c_1.

 

              v_no1 = l_step.                 "Serial no

              v_mfg_pno1 = wa_mpn_detail-partno. "MPN

 

            WHEN  c_2.

 

              v_no2 = l_step.                "Serial no

              v_mfg_pno2 = wa_mpn_detail-partno. "MPN

 

            WHEN  c_3.

 

              v_no3 = l_step.                 "Serial no

              v_mfg_pno3 = wa_mpn_detail-partno. "MPN

 

            WHEN  c_4.

 

              v_no4 = l_step.                 "Serial no

              v_mfg_pno4 = wa_mpn_detail-partno. "MPN

 

ENDCASE.

 

        ENDLOOP.

  1. ENDFORM.                    " SUB_init_MPN

 

 

STEP 4: Navigate the next records of the internal table one by one in tabular format when the user press up and down Button. It should be written in PAI of Screen.

 

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

*&      Form sub_navigate_DOWN

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

*       Navigate down the Manufacturing name  details

*----------------------------------------------------------------------*

FORM sub_navigate_down .

 

  DATA: l_track TYPE i.  "Keep track of records shown

 

* Compare with total no of records

  IF cnt_track < v_mpn_tot.

 

*check counter does not reach to end of record*

* Increase table record counter by 1

    cnt_track = cnt_track + 1.

 

    l_track = cnt_track.

*Show the Records of the table

    PERFORM sub_mpn_detail CHANGING l_track.

 

  ENDIF.

 

  1. ENDFORM.                    " SUB_SCROLL_UP

 

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

*&      Form SUB_navigate_UP

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

*     Navigate up the MPN details

*----------------------------------------------------------------------*

 

FORM sub_navigate_up .

  DATA: l_track TYPE i.  "Keep track of records shown

 

 

  IF cnt_track > c_4.

*Check  Begin of record has reached

 

* Decrease table record counter by 1

    cnt_track = cnt_track - 1.

    l_track = cnt_track.

*Show the records of the table

    PERFORM sub_mpn_detail CHANGING l_track.

 

  ENDIF.

  1. ENDFORM.                    " SUB_SCROLL_DOWN

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

*&      Form sub_MPN_detail

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

*     Read the internal table to show MPN Overview

*----------------------------------------------------------------------*

*  --> p1       l_track

 

*----------------------------------------------------------------------*

FORM sub_mpn_detail  CHANGING l_track.

 

*Show the fourth record at the table at screen

  READ TABLE itab_mpn_detail INDEX l_track INTO wa_mpn_detail.

 

  IF sy-subrc EQ 0.

 

*Assign into screen variales

    v_no4 = l_track.                  "Serial No

    v_mfg_pno4 = wa_mpn_detail-partno. "MPN

* Decrease counter by 1

  ENDIF.

  l_track = cnt_track - 1.

 

*Show the third record at the table at screen

  READ TABLE itab_mpn_detail INDEX l_track INTO wa_mpn_detail.

  IF sy-subrc EQ 0.

* Assign into screen variables

    v_no3 = l_track.                  "Serial No

    v_mfg_pno3 = wa_mpn_detail-partno. "MPN

  ENDIF.

*Decrease counter by 1

  l_track = cnt_track - 2.

 

 

*Show the second record at the table at screen

  READ TABLE itab_mpn_detail INDEX l_track INTO wa_mpn_detail.

  IF sy-subrc EQ 0.

    v_no2 = l_track.                "Serial No

    v_mfg_pno2 = wa_mpn_detail-partno."MPN

  ENDIF.

*Decrease counter by 1

  l_track = cnt_track - 3.

 

 

*Show the first record at the table at screen

  READ TABLE itab_mpn_detail INDEX l_track INTO wa_mpn_detail.

  IF sy-subrc EQ 0.

    v_no1 = l_track.                 "Serial No

    v_mfg_pno1 = wa_mpn_detail-partno."MPN

  ENDIF.

 

  1. ENDFORM.                    " sub_mat_detail

 

When it is displayed for the 1st time:

 

3.JPG

 

if user press Down Button:


4.JPG

 


if user press Down Button:


5.JPG

 

if user press UP Button:


6.JPG



Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>