Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2807

Re: pasting multiples entries from excel in table control

$
0
0

PROCESS BEFORE OUTPUT.

 

LOOP WITH CONTROL EMP_TC.
 
ENDLOOP.



PROCESS AFTER INPUT.

  MODULE COPY_PASTY_DATA.

LOOP WITH CONTROL EMP_TC.

ENDLOOP.



Write one module above table control as shown above.


write below code in that module (not exact code modify names as u declared)


* this for get copied code *

CALL METHOD CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT
   IMPORTING
     DATA                 = LT_COPY
     LENGTH               = LV_LEN
   EXCEPTIONS
     CNTL_ERROR           = 1
     ERROR_NO_GUI         = 2
     NOT_SUPPORTED_BY_GUI = 3
     OTHERS               = 4.

IF LT_COPY[] IS NOT INITIAL AND LV_LEN <> 0. " checking copied data is there or not

* this converting copied string into our table control data structure*


LOOP AT LT_COPY INTO LS_COPY.


CLEAR LS_COPYP.
SPLIT LS_COPY AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO
   LS_COPYP-PERNR LS_COPYP-ENAME LS_COPYP-DEPARTMENT
   LS_COPYP-SUBAREA LS_COPYP-SDATE LS_COPYP-EDATE
   LS_COPYP-STIME LS_COPYP-ETIME LS_COPYP-DESCRIPTION
   LS_COPYP-PROG_TYPE LS_COPYP-CONSULT_NAME LS_COPYP-VENUE
   LS_COPYP-TRTYPE LS_COPYP-REASON.

CLEAR LS_ZEMP.
MOVE-CORRESPONDING LS_COPYP TO LS_ZEMP.

 

* adding structure to table control table*


APPEND LS_ZEMP TO GT_ZEMP.

ENDLOOP.

* set table controls lines


  tablecontrol-lines = tablecontrol-lines + no of recods to be display or copied.


* for set copied data is null, for next command *


REFRESH:LT_COPY[].

CALL METHOD CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT
   IMPORTING
     DATA                 = LT_COPY
   CHANGING
     RC                   = LV_RC
   EXCEPTIONS
     CNTL_ERROR           = 1
     ERROR_NO_GUI         = 2
     NOT_SUPPORTED_BY_GUI = 3
     NO_AUTHORITY         = 4
     OTHERS               = 5.

  ENDIF.


Viewing all articles
Browse latest Browse all 2807

Trending Articles



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