ALV 프로그램으로 데이터 조회 후 조회 내역을 엑셀로 다운 받기 위해 버튼 Export / Local File 클릭을 하면 아래와 같은 에러가 발생 합니다.
어디가 잘못된건지 답변 부탁드립니다.
_______________ 에러 내용 _______________
Short text
The current statement requires a character-type data object.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLKKBL" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
At the statment
"STRLEN( obj )..."
, only character-type data objects are supported at the argument
position "obj".
In this particular case, the operand "obj" has the non-charcter-type type
"I".
Trigger Location of Runtime Error
Program SAPLKKBL
Include LKKBLF99
Row 3,908
Module type (FORM)
Module Name GEN_FIELD_OUT2
Source Code Extract
Line SourceCde
3878 using edit mask gs_fc-edit_mask.
3879 if gs_fc-inttype ca 'NnIiPpBbSs'. "Y7AK010240
3880 condense gs_out-hlpchar.
3881 endif.
3882 gs_out-hlplen = strlen( gs_out-hlpchar ).
3883 * Bei NUMC führende '0' und ' ' nicht berücksichtigen
3884 elseif gs_fc-tech_form = 6.
3887 condense gs_out-hlpchar.
3888 endif.
3889 gs_out-hlplen = strlen( gs_out-hlpchar ).
3890 elseif gs_fc-tech_form = 11. "INS TECH11
3891 * Min. Ausgabelänge für ein Datum ist immer 8
3892 if gs_fc-datatype = 'DATS'. "INS TECH11
3893 gs_out-hlplen = 8. "INS TECH11
3894 * Min. Ausgabelänge für eine Uhrzeit ist immer 6
3895 elseif gs_fc-datatype = 'TIMS'. "INS TECH11
3896 gs_out-hlplen = 6. "INS TECH11
3897 endif. "INS TECH11
3898 elseif gs_fc-tech_form = 1 or gs_fc-tech_form = 90.
3899 * Überführung int. in ext. Format via Konvertierungsexit
3900 if not gs_fc-convexit is initial or "INS TECH11
3901 not gs_fc-inttype ca 'CN'.
3902 * elseif not gs_fc-convexit is initial. "DEL TECH11
3903 write <field> to gs_out-hlpchar left-justified.
3904 gs_out-hlplen = strlen( gs_out-hlpchar ).
3905 * ansonsten entspricht sich min. Ausgabelänge und Ausprägungslänge
3906 else.
3907 if gs_fc-tech_form ne 99.
>>>>> gs_out-hlplen = strlen( <field> ).
3909 endif.
3910 endif.
3911 endif.
3912 * Falls Ausprägung abgeschnitten wird, dann wird noch ein weiterer
3913 * Charakter für die Visualisierung mittels Symbol reserviert
3914 if gs_out-hlplen > gs_fc-outputlen.
3915 if gs_fc-outputlen = 0.
3916 gs_out-hlplen = 0.
3917 else.
3918 gs_fc-outputlen = gs_fc-outputlen - 1.
3919 ">>Unicode/Doublebyte 1
3920 get parameter id 'SLI' field g_sli.
3921 if g_sli eq 'UNICODE' or g_sli eq 'MULTIBYTE' or
3922 not cl_gui_alv_grid=>m_multibyte is initial. "Y7AK013723
3923 data:
3924 im_pos_vis type i,
3925 im_pos_tech type i,
3926 ex_pos_vis type i,
3927 ex_pos_tech type i,
두가지로 볼 수 있는데요.
첫째는 버튼 구현만 해 놓고 이벤트에 대한 로직 구현을 안 한 경우.
그리고 다른 이유는 ALV 에서는 지향하지 않는 타입이 있는데 인터널 테이블에 필드 선언할 때
이러한 필드 타입을 선언한 경우입니다.
대표적인 예로는 typr char 또는 type dec 같은 것이 있습니다.
수고하세요.