Skip to Content
0
Former Member
Jan 31, 2010 at 08:45 PM

Generic datasource using FM with delta

20 Views

Hi All.

I am trying to write FM with delta for generic data source.In this FM i am using bellow coding as per my requirement.

In my structure i have timestamp,aufnr,auart,priok.

IF S_COUNTER_DATAPAKID = 0.

LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'AUFNR'.

MOVE-CORRESPONDING l_s_select TO l_r_aufnr.

APPEND l_r_aufnr.

ENDLOOP.

LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'TMSTMP'.

tstamp = l_s_select-low.

convert TIME STAMP tstamp TIME ZONE sy-zonlo

into DATE startDate TIME startTime.

tstamp = l_s_select-high.

convert TIME STAMP tstamp TIME ZONE sy-zonlo

into DATE endDate TIME endTime.

l_r_erdat-low = startDate.

l_r_erdat-sign = l_s_select-sign.

l_r_erdat-option = l_s_select-option.

l_r_erdat-high = endDate.

append l_r_erdat.

l_r_erfzeit-low = startTime.

l_r_erfzeit-sign = l_s_select-sign.

l_r_erfzeit-option = l_s_select-option.

l_r_erfzeit-high = endTime.

append l_r_erfzeit.

endloop.

SELECT aufnr auart astkz INTO TABLE ITAB "( aufnr auart priok )

FROM aufk

WHERE aufnr IN l_r_aufnr

and

(

( erdat >= startdate and ( erfzeit >= starttime OR ( erdat <=

enddate and erfzeit <= endtime ) ) ) OR ( aedat >= startdate and ( aezeit >=

starttime OR ( aedat <= enddate and aezeit <= endtime ) ) )

).

else.

LOOP AT ITAB INTO WA .

  • READ TABLE ITAB INTO WA WITH KEY AUFNR = W_T_DATA-AUFNR.

MOVE:WA-AUFNR TO E_T_DATA-AUFNR,

WA-ASTKZ TO E_T_DATA-PRIOK,

WA-AUART TO E_T_DATA-AUART.

CLEAR WA.

append E_T_DATA ."SIZE S_S_IF-MAXSIZE.

  • S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

ENDLOOP.

endif.

using this code data is coming but iam facing some problems.

1)when i check the data on rsa3 with delta it is giving error message.

2)when i check the data on rsa3 with out giving update mode data was coming to one data packet only,how to split that packet size.

3) iam geting time stam value is zero on rsa3

please give the solutions for this points and .give me if you have related this code.