2014 Apr 09 11:56 PM
Hello Gurus,
Someone please can help me to convert the table that is return by the function LIST_FROM_MEMORY into ascii with a field type C larger than 250 characteres?
call function 'LIST_FROM_MEMORY'
tables
listobject = it_listobj
exceptions
not_found = 1
others = 2.
I am using this
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = it_ascii
listobject = it_listobj
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
But I got an error because the field of internal table it_ascii has a field TYPE string, I have this because the function LIST_FROM_MEMORY returns it_listobj very large, so that's because I have to declare a type STRING field.
TYPES: BEGIN OF ty_ascii,
line TYPE string,
END OF ty_ascii.
Thanks in advance for your help gurus
2014 Apr 10 12:50 AM
Hi Enrique,
Instead of type string, try something like a very wide char field, say c(5000).
Cheers,
Custodio
2014 Apr 10 1:09 AM
Hi,
I forgot to mention that I have already try with 5000, 10 000, and it's the same, the field(5000) type c only captures 250. So i found that someone change the type to string, but my problema is that the FM I use to convert to ascii doesn't work with type string.
thanks.
2014 Apr 10 2:11 AM
The limit of 255 characters is because of program called using SUBMIT.
Report zprogramname line-size 1023.
Line size can be increased to maximum value of 1023 using this statement.
When you submit program zprogramname, list_from_asci would be able to capture more.
2014 Apr 10 2:17 PM
thanks for answer, it doesnt work. this is my code
*&---------------------------------------------------------------------*
*& Report ZHRPE_TEST1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zhrpe_test1.
TYPES: BEGIN OF ty_ascii,
line(2000) TYPE C,
END OF ty_ascii.
TYPES: BEGIN OF ty_ordper,
codigosap(8) type c, "P0002-PERNR Codigo SAP
nrodoc(30) type c, "P0185-ICNUM Numero de documento
paterno(40) type c, "P0002-NACHN Paterno
materno(40) type c, "P0002-NAME2 Materno
nombres(40) type c, "P0002-VORNA Nombres
sociedad(4) type c, "P0001-BUKRS Sociedad
dessociedad(25) type c,
centro(4) type c, "P0001-WERKS Centro
descentro(30) type c,
subdiviper(4) type c, "P0001-BTRTL Subdivisión de personal
dessubdiviper(15) type c,
unidorg(8) type c, "P0001_ORGEH Unidad organizativa
desunidorg(40) type c,
codadmnomina(3) type c, "P0001-SACHA Administrador de la nómina
descodadmnomina(20) type c,
areanomina(2) type c, "P0001-ABKRS Área de nómina
desareanomina(20) type c,
codccnomina(10) type c, "P0001-KOSTL Centro Costo Nomina
desccnomina(20) type c,
areapersonal(2) type c, "P0001-PERSK Planilla Área de personal
desareapersonal(20) type c,
grupopersonal(1) type c, "P0001-PERSG Grupo de personal
desgrupopersonal(20) type c,
codposicion(8) type c, "P0001-PLANS Posición
desposicion(40) type c,
fechaingreso(8) type c, "P0041-DAT01
situacion(40) type c, "P0000_STAT2
sexo(60) type c, "P0002_GESCH
fecmod(8) type c, "P0000-AEDTM
usuariomod(12) type c, "P0000-UNAME
fecnac(8) type c, "P0002-GBDAT
tipdoc(30) type c, "P0185_ICTYP
usuariosap(30) type c, "P0105_SYSUNAME
estadocivil(6) type c, "P0002_FAMST
codorden(12) type c, "P0027-AUF01
desorden(40) type c,
codcccosto(10) type c, "P0027-KST01
descccosto(20) type c,
fecinicosto(8) type c, "P0027-BEGDA
fecfincosto(8) type c, "P0027-ENDDA
END OF ty_ordper.
DATA: it_ordper type TABLE OF ty_ordper WITH HEADER LINE.
DATA: it_ordper_w type ty_ordper.
DATA: rspar TYPE TABLE OF rsparams,
wa_rspar LIKE LINE OF rspar.
DATA: it_listobj LIKE abaplist OCCURS 0 WITH HEADER LINE,
it_ascii TYPE STANDARD TABLE OF ty_ascii WITH HEADER LINE.
DATA: t_ascilist TYPE STANDARD TABLE OF abaplist,
lrec_abap_list TYPE abaplist.
START-OF-SELECTION.
wa_rspar-selname = 'SP$00005-LOW'.
wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'.
wa_rspar-option = 'EQ'.
wa_rspar-low = '3'.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'SP$00001-LOW'.
wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'.
wa_rspar-option = 'EQ'.
wa_rspar-low = '65000006'.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'PNPBEGDA'.
wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'.
wa_rspar-option = 'EQ'.
wa_rspar-low = '20140301'.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'PNPENDDA'.
wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'.
wa_rspar-option = 'EQ'.
wa_rspar-low = '20140331'.
APPEND wa_rspar TO rspar.
SUBMIT AQA0ZPEHR=======ZHR0010======= WITH SELECTION-TABLE rspar
EXPORTING LIST TO MEMORY AND RETURN LINE-SIZE 1023 .
* Retrieves the Report List from memory
call function 'LIST_FROM_MEMORY'
tables
listobject = it_listobj
exceptions
not_found = 1
others = 2.
refresh it_ascii.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = it_ascii
listobject = it_listobj
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT it_ascii.
SEARCH it_ascii-line FOR '----'.
IF sy-subrc EQ 0.
DELETE it_ascii.
CLEAR it_ascii.
ENDIF.
ENDLOOP.
data: g_count type i value 0.
LOOP AT it_ascii.
if g_count > 0.
it_ordper_w-codigosap = it_ascii-line+1(18).
it_ordper_w-nrodoc = it_ascii-line+20(30).
it_ordper_w-paterno = it_ascii-line+51(40).
it_ordper_w-materno = it_ascii-line+92(40).
it_ordper_w-nombres = it_ascii-line+133(40).
it_ordper_w-sociedad = it_ascii-line+174(4).
it_ordper_w-dessociedad = it_ascii-line+179(25).
it_ordper_w-centro = it_ascii-line+205(4).
it_ordper_w-descentro = it_ascii-line+210(30).
it_ordper_w-subdiviper = it_ascii-line+241(4).
it_ordper_w-dessubdiviper = it_ascii-line+246(15).
it_ordper_w-unidorg = it_ascii-line+262(8).
it_ordper_w-desunidorg = it_ascii-line+271(40).
it_ordper_w-codadmnomina = it_ascii-line+312(3).
it_ordper_w-descodadmnomina = it_ascii-line+316(20).
it_ordper_w-areanomina = it_ascii-line+337(2).
it_ordper_w-desareanomina = it_ascii-line+340(20).
it_ordper_w-codccnomina = it_ascii-line+361(10).
it_ordper_w-desccnomina = it_ascii-line+372(20).
it_ordper_w-areapersonal = it_ascii-line+393(2).
it_ordper_w-desareapersonal = it_ascii-line+396(20).
it_ordper_w-grupopersonal = it_ascii-line+417(1).
it_ordper_w-desgrupopersonal = it_ascii-line+419(20).
it_ordper_w-codposicion = it_ascii-line+440(8).
it_ordper_w-desposicion = it_ascii-line+449(40).
it_ordper_w-fechaingreso = it_ascii-line+490(8).
it_ordper_w-situacion = it_ascii-line+499(40).
it_ordper_w-sexo = it_ascii-line+540(60).
it_ordper_w-fecmod = it_ascii-line+601(8).
it_ordper_w-usuariomod = it_ascii-line+610(12).
it_ordper_w-fecnac = it_ascii-line+623(8).
it_ordper_w-tipdoc = it_ascii-line+632(30).
it_ordper_w-usuariosap = it_ascii-line+663(30).
it_ordper_w-estadocivil = it_ascii-line+694(6).
it_ordper_w-codorden = it_ascii-line+701(12).
it_ordper_w-desorden = it_ascii-line+714(40).
it_ordper_w-codcccosto = it_ascii-line+755(10).
it_ordper_w-descccosto = it_ascii-line+766(20).
it_ordper_w-fecinicosto = it_ascii-line+787(8).
it_ordper_w-fecfincosto = it_ascii-line+796(8).
APPEND it_ordper_w to it_ordper.
WRITE:/ it_ordper_w-codigosap.
ENDIF.
g_count = g_count + 1.
clear it_ordper_w.
ENDLOOP.
SKIP 2.
ENDIF.
ENDIF.
2014 Apr 10 2:18 PM
neither Works with this sintax
SUBMIT AQA0ZPEHR=======ZHR0010======= LINE-SIZE 1023 WITH SELECTION-TABLE rspar EXPORTING LIST TO MEMORY AND RETURN .
what would be the solution?