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: 

help to run FM in second time

Former Member
0 Kudos

HI,

i have bug in FM that i create (rfc) when i execute the function in the first time its working <b>o.k</b>. (the table is full with data) and when i push on button back f3 (<b>just</b> <b>one time</b>) and i execute it again i get <b>empty</b> table .

i check other rfc that i do and its not happen (when i push back and run again i get the same results) what can be the problem ?

Regards

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

hav u used ny statements like refresh or clear in fm...

can u send da code

3 REPLIES 3

former_member188827
Active Contributor
0 Kudos

hav u used ny statements like refresh or clear in fm...

can u send da code

0 Kudos

HI ABAPUSER

this is my code

thankes for your time


______________________Get Data____________________________________________*


   CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
    EXPORTING
      input  = project
    IMPORTING
      output = ps_psp_pnr.




    SELECT SINGLE prart pbukr erdat
    FROM prps
    INTO (project_type ,l_pbukr,l_erdat)
    WHERE pspnr = ps_psp_pnr.

    SELECT SINGLE waers
    FROM t001
    INTO l_waers
    WHERE bukrs = l_pbukr.



*---------Check which table do the select according to ps_psp_pnr & project_type-----------

    CLEAR:proj_tab_name,proj_tab_name2.

    IF ( project_type EQ 'C0' OR  project_type EQ 'CB' OR project_type EQ 'C+' ).
      proj_tab_name = 'ZTR'.proj_tab_name2 = 'ZZENEW' .

    ELSEIF ( project_type EQ 'F1' OR  project_type EQ 'F2' OR project_type EQ 'F3' ).
      proj_tab_name = 'ZTR1'.proj_tab_name2 = 'ZZR_ZEFI1_NEW'.

    ELSEIF ( project_type EQ 'XO' OR  project_type EQ 'XE' OR project_type EQ 'XI' OR project_type EQ 'XS').
      proj_tab_name = 'ZTRU'. proj_tab_name2 = 'ZZE_NEW'.

    ELSEIF project_type EQ 'F0'.
      proj_tab_name = 'ZTR'. proj_tab_name2 = 'ZZZEFI3'.
    ENDIF.

   SELECT  op01 op02 op03 op04 op05 op06 op07 op08 op09 op10 op11 op12 "oply
    FROM (proj_tab_name)
    INTO TABLE truma_tab   "from year start project until sy-datum
    WHERE zyear = year
*      start_date(4)
    AND ps_psp_pnr = ps_psp_pnr
    AND curr = l_waers.



    SELECT  zever01 zever02 zever03 zever04 zever05 zever06 zever07 zever08 "hny
               zever09 zever10 zever11 zever12
    FROM (proj_tab_name2)
    INTO TABLE zefi_tab
    WHERE zyear = year
*      start_date(4)  "from year start project until sy-datum
    AND ps_psp_pnr = ps_psp_pnr
    AND curr = l_waers.

 PERFORM divide USING p1 p2 p3.

    LOOP AT truma_tab ASSIGNING <fs_truma>.
      READ TABLE zefi_tab ASSIGNING <fs_zefi> INDEX sy-index.
      IF sy-subrc = 0.
        PERFORM divide USING:
*                             <fs_truma>-last_yaer <fs_zefi>-last_yaer  wa_per_tab-last_yaers,
                              <fs_truma>-month1    <fs_zefi>-month1     wa_per_tab-month1,
                              <fs_truma>-month2    <fs_zefi>-month2     wa_per_tab-month2,
                              <fs_truma>-month3    <fs_zefi>-month3     wa_per_tab-month3,
                              <fs_truma>-month4    <fs_zefi>-month4     wa_per_tab-month4,
                              <fs_truma>-month5    <fs_zefi>-month5     wa_per_tab-month5,
                              <fs_truma>-month6    <fs_zefi>-month6     wa_per_tab-month6,
                              <fs_truma>-month7    <fs_zefi>-month7     wa_per_tab-month7,
                              <fs_truma>-month8    <fs_zefi>-month8     wa_per_tab-month8,
                              <fs_truma>-month9    <fs_zefi>-month9     wa_per_tab-month9,
                              <fs_truma>-month10   <fs_zefi>-month10    wa_per_tab-month10,
                              <fs_truma>-month11   <fs_zefi>-month11    wa_per_tab-month11,
                              <fs_truma>-month12   <fs_zefi>-month12    wa_per_tab-month12.

        APPEND wa_per_tab TO per_tab.
        CLEAR wa_per_tab.
      ENDIF.
    ENDLOOP.


REGARDS

0 Kudos

its difficult to point out why ur table gets blank since i cant execute ur code........

've u tried to debug it..

put a breakpoint at point where u populate ur table and check y its getting blsnk