EBELN
How to add leading zeros to an info object value .
Eg: EBELN is 10 digit but sometimes we get less than 10 digits in this field because of which the load is failing . I want to write a formula to make the less than 10 digit values into 10 by adding leading 0's.
Thanks
Is it not possible that in the transfer rules , I have a formula for an info object and also have the check mark for conversion.
I have a formula for convert to upper case and the check for alpha conversion. The alpha conversion works fine but my load is failing because of the lower case issue . So my first guess is probably they do not work together.
Please advice on how to handle these 2 situations.
Thanks
Similar Messages
-
When clic in the field "i_ekpo-ebeln" tab exit in report ALV
Good Afternoon! *********************************************************
Coloquei all the code, I believe for better clarification. When clico in the field i_ekpo-ebeln in the report is called transaction ME23 c/o GRID this functioning normally, but with the reports List and Hierarquico it does not happen the same and it prints in the baseboard the message "Invalid Function". when standard use buttons, functions of course.
obs.: I had that to create a SET Pf-status for each type of report pos I wanted that when clicar in the field box and clicar in the button "TO PRINT REPORT" it printed sapscript. How I make to solve such problem?
Att, Carlos Eduardo.
REPORT ztreino NO STANDARD PAGE HEADING LINE-SIZE 220.
************************declarações*********************
DATA: BEGIN OF y_ekko OCCURS 0,
ebeln TYPE ekko-ebeln, "Nº documento de compra
bukrs TYPE ekko-bukrs, "Empresa
bsart TYPE ekko-bsart, "Documento de compra
loekz TYPE ekko-loekz, "Código de eliminação
aedat TYPE ekko-aedat, "Data de criação do registro
ernam TYPE ekko-ernam, "Nome do responsável que criou o objeto
lifnr TYPE ekko-lifnr, "Nº conta do fornecedor
ekgrp TYPE ekko-ekgrp, "Grupo de compradores
waers TYPE ekko-waers, "Chave da moeda
BOX TYPE ptrv_approval-box, "campo para chekinbox
END OF y_ekko,
BEGIN OF y_ekpo OCCURS 0,
ebeln TYPE ekpo-ebeln, "Nº documento de compra
ebelp TYPE ekpo-ebelp, "Nº item do documento de compra
loekz TYPE ekpo-loekz, "Código de eliminação
txz01 TYPE ekpo-txz01, "Texto breve
matnr TYPE ekpo-matnr, "Nº material
bukrs TYPE ekpo-bukrs, "Empresa
werks TYPE ekpo-werks, "Centro
menge TYPE ekpo-menge, "Quantidade do pedido
netpr TYPE ekpo-netpr, "Preço líquido no documento de compra
BOX TYPE ptrv_approval-box, "campo para chekinbox
END OF y_ekpo.
*início seleção de dados
SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-000.
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
*Nº documento de compra
SELECT-OPTIONS : s_ebeln FOR ekko-ebeln NO INTERVALS OBLIGATORY,
s_bukrs FOR ekko-bukrs OBLIGATORY, "Empresa
s_bsart FOR ekko-bsart. "Documento de compra
SELECTION-SCREEN END OF BLOCK bl1.
SELECTION-SCREEN END OF BLOCK bl2.
**fim da seleção de dados----
**início da variante
SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-000.
SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-002.
PARAMETERS : p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK bl3.
SELECTION-SCREEN END OF BLOCK bl4.
***fim variante -
***início modo relatório
SELECTION-SCREEN BEGIN OF BLOCK bl5 WITH FRAME TITLE text-000.
SELECTION-SCREEN BEGIN OF BLOCK bl6 WITH FRAME TITLE text-003.
SELECTION-SCREEN SKIP.
PARAMETERS : rb1 RADIOBUTTON GROUP TIPO DEFAULT 'X',
rb2 RADIOBUTTON GROUP TIPO,
rb3 RADIOBUTTON GROUP TIPO.
SELECTION-SCREEN END OF BLOCK bl6.
SELECTION-SCREEN END OF BLOCK bl5.
****fim modo relatório
*******início da opção de download
Dados do arquivo texto de saída.
SELECTION-SCREEN BEGIN OF BLOCK bl9 WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) text-005.
PARAMETERS: p_gerar AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) text-006.
PARAMETERS: p_dir LIKE rlgrap-filename DEFAULT 'c:'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(15) text-007.
PARAMETERS: p_arq LIKE rlgrap-filename DEFAULT 'nota-geral.txt'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK bl9.
DATA :
i_ekko LIKE y_ekko OCCURS 0 WITH HEADER LINE,
i_ekpo LIKE y_ekpo OCCURS 0 WITH HEADER LINE.
i_tabsaida LIKE y_saida OCCURS 0 WITH HEADER LINE.
*********************Fim Declarações*******************************
*********************Declarações ALV*******************************
TYPE-POOLS : slis.
DATA :
s_layout TYPE slis_layout_alv,
t_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE,
t_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
s_grupos TYPE slis_t_sp_group_alv WITH HEADER LINE,
s_keyinfo TYPE slis_keyinfo_alv,
extab TYPE slis_t_extab.
DATA :
variant_exit(1) TYPE c,
def_variant(1) TYPE c,
s_print TYPE slis_print_alv,
s_top TYPE slis_t_listheader,
variante TYPE disvariant,
def_variante TYPE disvariant,
v_repid LIKE sy-repid,
*------pega a data que esta rodando a transação
v_datasaida(10) TYPE C,
*------para saber quantos Pedidos na EKKO
v_exibe TYPE I,
s_selfield type slis_selfield,
v_ucomm like sy-ucomm.
**********************Fim declarações ALV*************************
Contants para Sapscript e declarações *
TABLES: ITCPO.
CONSTANTS: c_on(1) TYPE C VALUE 'X', "Parâmetro para o Sapscript
c_off(1) TYPE C VALUE ''. "Parâmetro para o Sapscript
Data:
v_element(15) TYPE C, "Elemento de texto do Sap Script
v_type(15) TYPE C, "BODY
v_window(15) TYPE C, "Janela
flag TYPE I, "Uma condição para impressão do sapscript
resp TYPE C, "resposta para confirmação do download tab
zlen TYPE I, "Para verificar o um diretório válido
Para a função WS_DOWNLOAD só em declarar as variaveis deste tipo já *
seria o bastante para passar o caminho para a função
TABLES : ekko, ekpo.
initialization *
INITIALIZATION.
PERFORM zf_verifica_variante.
at selection-screen on value-request *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM zf_busca_variante_existente.
at seletion-screen *
AT SELECTION-SCREEN.
PERFORM zf_valida_variante.
validar os campo antes de fazer download do arquivo
PERFORM zf_trata_parametros_gerar_arqu.
start-of-selection *
START-OF-SELECTION.
PERFORM zf_seleciona_dados.
Criando ALV *
PERFORM zf_alv.
*& Form zf_verifica_variante
text
--> Verifica se a variante selecionada é existente
FORM zf_verifica_variante.
CLEAR variante.
v_repid = sy-repid.
variante-report = v_repid.
Buscar variante default
def_variante = variante.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = def_variante
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc EQ 0.
p_vari = def_variante-variant.
ENDIF.
ENDFORM. " zf_verifica_variante
*& Form zf_busca_variante_existente
*- text
*- --> Vai buscar a variante existente
FORM zf_busca_variante_existente.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = variante " Report com as
i_save = 'A' " Variantes Salvas
i_tabname_header = 'I_EKPO' " Tabela interna saida
it_default_fieldcat = t_fieldcat[] " Tabela de formatação
i_display_via_grid = 'X' " Dispara POPUP em ALV
IMPORTING
e_exit = variant_exit " Se não existir variante X
es_variant = def_variante " Variante default
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF variant_exit = space.
p_vari = def_variante-variant. " Recebe variante escolhida
ENDIF.
ENDIF.
ENDFORM. " zf_busca_variante_existente
*-& Form zf_valida_variante
*- text
*- --> Verifica se a variante digitada é válida.
FORM zf_valida_variante.
IF NOT p_vari IS INITIAL.
variante = def_variante. "nome do report
def_variante-variant = p_vari. "nome que foi digitado
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = def_variante
variante = def_variante.
ELSE.
clear variante.
variante-report = v_repid.
ENDIF.
ENDFORM. " zf_valida_variante
-& Form zf_seleciona_dados
*- text
--> Seleciona os dados da ekko e ekpo
FORM zf_seleciona_dados.
SELECT ebeln
bukrs
bsart
loekz
aedat
ernam
lifnr
ekgrp
waers
FROM ekko
INTO TABLE i_ekko
WHERE
( ebeln IN s_ebeln AND
bsart EQ 'NB' ).
SORT I_EKKO ASCENDING.
IF sy-subrc EQ 0.
SELECT ebeln
ebelp
loekz
txz01
matnr
bukrs
werks
menge
netpr
FROM ekpo
INTO TABLE i_ekpo
FOR ALL ENTRIES IN i_ekko
WHERE
( ebeln EQ i_ekko-ebeln ).
ENDIF.
SORT I_EKPO ASCENDING.
Para exibir no topo do relatório no grid
DESCRIBE TABLE I_EKKO LINES v_exibe.
ENDFORM. " zf_seleciona_dados
*-& Form zf_ALV
*- text
--> Opções de alv
FORM zf_alv.
IF rb1 = 'X'.
PERFORM zf_gri.
ENDIF.
IF rb2 = 'X'.
PERFORM ZF_HIERARQUICO.
ENDIF.
IF rb3 = 'X'.
PERFORM ZF_LIST.
ENDIF.
ENDFORM. " zf_ALV
*& Form zf_gri
*- text
*- --> Seqüência para gerar o alv grid
FORM zf_gri.
PERFORM zf_layout.
PERFORM zf_ordena_campos.
PERFORM zf_monta_campos_alv.
PERFORM zf_print.
PERFORM zf_grupo.
PERFORM zf_top USING s_top.
IF NOT I_EKPO[] IS INITIAL.
PERFORM zf_imprime_alv.
ELSE.
MESSAGE s000(zcl001) WITH 'Nenhum registro encontrado.'.
STOP.
ENDIF.
ENDFORM. " zf_gri
*-& Form zf_layout
*- text
--> cria o layout do alv
FORM zf_layout.
s_layout-box_tabname = 'I_EKPO'.
s_layout-box_fieldname = 'BOX'.
s_layout-get_selinfos = 'X'.
s_layout-detail_popup = 'X'.
s_layout-detail_initial_lines = 'X'.
s_layout-zebra = 'X'.
s_layout-colwidth_optimize = 'X'.
ENDFORM. " zf_layout
*-& Form zf_ordena_campos
*- text
--> Ordenação dos campos
FORM zf_ordena_campos.
CLEAR t_sort.
t_sort-spos = '1'. "prioridade de ordenação
t_sort-fieldname = 'EBELN'. "campo da tab int. de saida
t_sort-tabname = 'I_EKPO'. "tab inter de saida
t_sort-up = 'X'. "ordenação do maior para o menor
APPEND t_sort.
ENDFORM. " zf_ordena_campos
*-& Form zf_monta_campos_alv
text
--> è passado os campos de acordo com a ordem de exibição inicial
FORM zf_monta_campos_alv.
IF rb2 = 'X'.
CLEAR t_FIELDCAT.
t_FIELDCAT-FIELDNAME = 'BOX'.
t_FIELDCAT-TABNAME = 'I_EKKO'.
t_FIELDCAT-CHECKBOX = 'X'.
t_FIELDCAT-INPUT = 'X'.
APPEND t_FIELDCAT.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'EBELN'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'EBELN'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'BUKRS'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'BUKRS'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'BSART'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'BSART'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'AEDAT'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'AEDAT'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'ERNAM'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'ERNAM'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'LIFNR'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'LIFNR'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'EKGRP'.
t_fieldcat-tabname = 'I_EKKO'.
t_fieldcat-ref_fieldname = 'EKGRP'.
t_fieldcat-ref_tabname = 'EKKO'.
APPEND t_fieldcat.
ENDIF.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'EBELN'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'EBELN'.
t_fieldcat-ref_tabname = 'EKPO'.
t_fieldcat-key = 'X'.
t_fieldcat-Hotspot = 'X'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
T_fieldcat-fieldname = 'EBELP'.
T_fieldcat-tabname = 'I_EKPO'.
T_fieldcat-ref_fieldname = 'EBELP'.
T_fieldcat-ref_tabname = 'EKPO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'MATNR'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'MATNR'.
t_fieldcat-ref_tabname = 'EKPO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'WERKS'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'WERKS'.
t_fieldcat-ref_tabname = 'EKPO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'MENGE'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'MENGE'.
t_fieldcat-ref_tabname = 'EKPO'.
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'NETPR'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'NETPR'.
t_fieldcat-ref_tabname = 'EKPO'.
t_fieldcat-do_sum = 'X'. "totalizar campo
APPEND t_fieldcat.
CLEAR t_fieldcat.
t_fieldcat-fieldname = 'TXZ01'.
t_fieldcat-tabname = 'I_EKPO'.
t_fieldcat-ref_fieldname = 'TXZ01'.
t_fieldcat-ref_tabname = 'EKPO'.
APPEND t_fieldcat.
ENDFORM. " zf_monta_campos_alv
*-& Form zf_top
*- text
*- --> Cria o texto de cabeçalho do ALV, passando por parametro o
--> p_S_TOP para s_top
FORM zf_top USING p_s_top TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'Relatório de Compras por Classificação Contábil'.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-KEY = 'Parametros Seleção '.
ls_line-info = '- Documento de compra'.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = '- Empresa'.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = '- Tip.doc.compra'.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-KEY = 'Total Pedido'.
ls_line-info = v_exibe.
APPEND ls_line TO p_s_top.
início Formatar a data
CALL FUNCTION 'DATUMSAUFBEREITUNG'
EXPORTING
IDATE = SY-DATUM
IMPORTING
TDAT8 = v_datasaida.
Fim Formatar a data
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-KEY = 'Data da execução'.
ls_line-info = v_datasaida.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-KEY = 'Usuário'.
APPEND ls_line TO p_s_top.
CLEAR ls_line.
ls_line-typ = 'A'.
ls_line-info = sy-uname.
APPEND ls_line TO p_s_top.
ENDFORM. " zf_top
*-& Form zf_print
*- text
*- --> Parametros de Impressão para o ALV
FORM zf_print.
s_print-no_print_selinfos = 'N'.
s_print-no_print_listinfos = 'N'.
ENDFORM. " zf_print
*-& Form zf_imprime_alv
*- text
*- --> Imprime o ALV c/ seu parametros
FORM zf_imprime_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PF_STATUS_SET = 'ZSET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'ZF_USER_COMMAND'
i_callback_program = v_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = s_layout
it_fieldcat = t_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS = S_GRUPOS[]
it_sort = t_sort[]
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = 'A'
is_variant = variante
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT = S_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = I_EKPO
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " zf_imprime_alv
*-& Form zf_top-of-page
*- text
--> Cabeçalho ALV
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = s_top
i_logo = 'CARLOS_LOGO3'.
I_END_OF_LIST_GRID = .
ENDFORM. " zf_top-of-page
*-& Form ZF_HIERARQUICO
*- text
*- --> RELATÓRIO HIERÁQUICO
form ZF_HIERARQUICO.
PERFORM zf_layout.
PERFORM zf_ordena_campos.
PERFORM zf_monta_campos_alv.
PERFORM zf_print.
PERFORM zf_grupo.
IF NOT I_EKPO[] IS INITIAL.
PERFORM zf_imprime_hierarquico_alv.
ELSE.
MESSAGE s000(zcl001) WITH 'Nenhum registro encontrado.'.
STOP.
ENDIF.
endform. " ZF_HIERARQUICO
*-& Form zf_grupo
text
--> Não é fundamental a criação de grupos de campos, mas facilita
ao usuário na hora de escolher os campos de exibição após o clique do
botão MODIFICAR LAYOUT . Vários campos da fieldcat podem ser
definidos para um mesmo grupo de campo.
form zf_grupo.
MOVE:'Moeda' TO S_GRUPOS-SP_GROUP,
'Campos moeda' TO S_GRUPOS-TEXT.
APPEND S_GRUPOS.
endform. " zf_grupo
*& Form zf_imprime_hierarquico_alv
text
--> p1 text
<-- p2 text
form zf_imprime_hierarquico_alv.
Vamos definir as ligações entre as tabelas para as quebras no momento
da impressão.
s_keyinfo-header01 = 'EBELN'.
s_keyinfo-item01 = 'EBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_USER_COMMAND = 'ZF_USER_COMMAND'
I_CALLBACK_PF_STATUS_SET = 'ZF_SET_PF_STATUS_HIERARQ'
I_CALLBACK_PROGRAM = v_repid
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = T_FIELDCAT[]
IT_SPECIAL_GROUPS = S_GRUPOS[]
IT_SORT =
IT_FILTER =
- Parâmetro p/executar sempre com a variante default
I_DEFAULT = 'X'
- Se é possível salvar as variantes
I_SAVE = 'A'
- Nome da variante selecionada
IS_VARIANT = VARIANTE
IT_EVENTS =
IT_EVENT_EXIT =
i_tabname_header = 'I_EKKO'
i_tabname_item = 'I_EKPO'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = S_KEYINFO
IS_PRINT = S_PRINT
IS_REPREP_ID =
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab_header = I_EKKO
t_outtab_item = I_EKPO.
endform. " zf_imprime_hierarquico_alv
*& Form ZF_LIST
text
--> p1 text
<-- p2 text
form ZF_LIST.
PERFORM zf_layout.
PERFORM zf_ordena_campos.
PERFORM zf_monta_campos_alv.
PERFORM zf_print.
PERFORM zf_grupo.
IF NOT I_EKPO[] IS INITIAL.
PERFORM zf_imprime_list_alv.
ELSE.
MESSAGE s000(zcl001) WITH 'Nenhum registro encontrado.'.
STOP.
ENDIF.
endform. " ZF_LIST
*& Form zf_imprime_list_alv
text
--> p1 text
<-- p2 text
form zf_imprime_list_alv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PF_STATUS_SET = 'ZF_SET_PF_STATUS_LIST'
I_CALLBACK_USER_COMMAND = 'ZF_USER_COMMAND'
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_STRUCTURE_NAME = 'I_EKPO'
IS_LAYOUT = S_LAYOUT
IT_FIELDCAT = T_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS = S_GRUPOS[]
IT_SORT = T_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT = VARIANTE
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT = S_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = I_EKPO.
endform. " zf_imprime_list_alv
*& Form zf_user_command
text
--> p1 text
<-- p2 text
form zf_user_command using p_v_ucomm like SY-UCOMM
p_s_selfield type slis_selfield.
*---tratamento de impressão do Sapscript----
CASE p_v_ucomm.
FLAG = 0.
WHEN 'IMPRIMIR' OR 'PRINT'.
LOOP AT i_ekpo.
IF NOT i_ekpo-BOX IS INITIAL.
FLAG = FLAG + 1.
ENDIF.
ENDLOOP.
se tiver selecionado apenas uma box
IF flag EQ 1.
IF p_gerar EQ 'X'.
*-----perform para confirmação de download
PERFORM zf_popup_to_confirm.
ENDIF.
*------chama o form para imprimir o sapscript
PERFORM zf_sapscript.
ENDIF.
box estiver vazia
IF flag EQ 0.
MESSAGE E017(ZCL_GRUPO04). "Selecione apenas uma BOX
"referente ao pedido de compras.
STOP.
ENDIF.
"estiver selecionado + de uma box
IF flag GT 1.
MESSAGE E017(ZCL_GRUPO04). "Selecione apenas uma
"BOX referente ao pedido de compra.
STOP.
ENDIF.
ENDCASE.
CASE p_s_selfield-sel_tab_field.
*observe na exibição do relatório(hierarquico) que temos o EKKO-EBELN
ficaria melhor visualmente, a utilização de clicar no mesmo
WHEN 'I_EKPO-EBELN'. "tab de saida
SET PARAMETER ID 'BES' FIELD p_s_selfield-VALUE.
CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
ENDCASE.
endform. " zf_user_command
*& Form ZSET_PF_STATUS
text
-->P_EXTAB text
form ZSET_PF_STATUS using p_extab.
set pf-status 'BOTOES' EXCLUDING extab.
endform. " ZSET_PF_STATUS
*& Form zf_sapscript
text
--> p1 text
<-- p2 text
form zf_sapscript.
--carregar a ITCPO----
PERFORM zf_itcpo.
----chamar a função Open_form
PERFORM zf_open_form.
*----buscar o fornecedor e seus dados
LOOP AT I_ekko.
v_element = 'CABPRIN'.
v_type = 'BODY'.
v_window = 'JANCABEC'.
PERFORM zf_imprime_form USING v_element
v_type
v_window.
ENDLOOP.
*----buscar o documento de compra selecionado
LOOP AT i_ekpo.
IF i_ekpo-BOX = 'X'.
v_element = 'MAIN'.
v_type = 'BODY'.
v_window = 'MAIN'.
PERFORM zf_imprime_form USING v_element
v_type
v_window.
*---o comando EXIT é para que somente quando 1 registro for selecionado
no relatório e a verificação da igualdade acontecer faz que saia do
Loop
EXIT.
ENDIF.
ENDLOOP.
PERFORM zf_close_form.
endform. " zf_sapscript
*& Form zf_itcpo
text
--> p1 text
<-- p2 text
form zf_itcpo.
*Parâmetros para impressão da tabela ITCPO
ITCPO-TDCOPIES = 1. "Quantidade de cópias
ITCPO-TDPAGESLCT = ''. "Seleção de páginas
ITCPO-TDPROGRAM = SY-REPID. "Captura o nome do programa
ITCPO-TDIMMED = c_on. "Saída imediata do relatório
ITCPO-TDPREVIEW = c_on. "Exibição prévia do relatório
ITCPO-TDDEST = 'LOCL'. "SPOOL: dispositivo de saída
ITCPO-TDFAXUSER = SY-UNAME. "Usuário logado naquele momento
ITCPO-TDSENDDATE = SY-DATUM. "Data de envio desejada
ITCPO-TDSENDTIME = SY-UZEIT. "Hora envio desejada
ITCPO-TDNEWID = c_on. "Nova ordem SPOOL
ITCPO-TDARMOD = c_on. "IMPRIMIR: modo de arquivamento
ITCPO-TDTITLE = 'Relatório de Compras por Classificação Contábil'.
endform. " zf_itcpo
*& Form zf_open_formBoa Tarde Carlos,
Welcome to the SDN Forums. SDN gets it's power from the large community throughout the world. To harvest that power of knowledge we have settled on one language for posts here which is English.
Clearly English is not your first language, but don't be afraid, I would vouch that for most of the participant here on SDN English is the second language.
As it is for me. I am just lucky, that I am living in the States long enough that German colleagues start to look at me strangely when I talk to them in German, because it doesn't totally sound right anymore
So we are very forgiving her in SDNland regarding grammar and spelling (although not as much anymore in the Weblogs), we even provide a spell checker.
Please post your question again in English.
If people don't understand you they will ask you about the things that they don't understand and you can then clarify.
Try it out. Your chance of an excellent responds is way higher.
Boa sorte, Mark. -
Custom report -Mb51 -EBELN,AUFNR,KDAUF & KUNNR -Data issues
Hi,
This custom report is related to material document list (MB51).
I was trying to retrieve Purchase Order(EBELN),Order number(AUFNR),Sales order(KDAUF) & Ship-to-party( KUNNR) from MSEG & MKPF.
Unfortunately
It looks like for Sales Orders, it picks up the Customer Number but no Order Number. For STOs, it looks like it picks up the STO # but no Customer #.
How to over come this?
FYI..I also tried adding fields to standard report(MB51) and it is also doing the same manner .
Am I pulling it from Wrong tables? or is it related to DATA issues?
Regards
Praveen
Message was edited by:
PRAVEEN sHi,
This custom report is related to material document list (MB51).
I was trying to retrieve Purchase Order(EBELN),Order number(AUFNR),Sales order(KDAUF) & Ship-to-party( KUNNR) from MSEG & MKPF.
Unfortunately
It looks like for Sales Orders, it picks up the Customer Number but no Order Number. For STOs, it looks like it picks up the STO # but no Customer #.
How to over come this?
FYI..I also tried adding fields to standard report(MB51) and it is also doing the same manner .
Am I pulling it from Wrong tables? or is it related to DATA issues?
Regards
Praveen
Message was edited by:
PRAVEEN s -
Is there a user exit to include Purchase Order (EBELN) in RFFOUS_T?
Is there a user exit to include the Purchase Order Number (EBELN) on the Payment Advice generated from RFFOUS_T? Or is this a custom modification?
I have field REGUP-EBELN defined in the form Z110_US_AVIS_SAP (clone of F110_US_AVIS_SAP), but the print program does NOT populate REGUP-EBELN.Hi,
Please follow this an Example:-
The COOIS report (Order Info System) gives the complete information regarding Production Order like header report, Operation report, Component Report, document report.
This document deals with the addition of extra fields in the output display of COOIS.
For the demo purpose, I have added the material group (MATKL) for the production order material for header report.
BADI Name: WORKORDER_INFOSYSTEM
Method: TABLES_MODIFY_LAY
In the method TABLES_MODIFY_LAY there are many table parameters for different data display of the production order .In this scenario only the header detail structure is being extended with append structure.
Add the extra fields to be displayed to through append structure to IOHEADER_TAB, here MATKL.
In the method write the code for updating the field value.
DATA : BEGIN OF st_matkl,
matkl TYPE matkl,
END OF st_matkl.
DATA : st_header TYPE ioheader.
LOOP AT ct_ioheader INTO st_header.
IF NOT st_header IS INITIAL.
SELECT SINGLE matkl
FROM mara
INTO st_matkl
WHERE matnr = st_header-matnr.
ENDIF.
st_header-matkl = st_matkl-matkl.
MODIFY ct_ioheader FROM st_header.
ENDLOOP.
Regards,
Ravi -
Hi All,
I want the Ebeln, lifnr and matnr fields in BSEG table for Account Type = GL Accountiing. Because of performance i want to use other table to get the same datas.
I checked in BSIS and BSAS table, but fields are not in the table. Could you please advice in which table(other than BSEG) i has to refer to get EBELN, MATNR and LIFNR.
- RKTotal Posts: 124
Total Questions: 62 (38 unresolved)
Please think about cleaning up your old posts.
Also look at [Quickly Retrieving FI document Data from BSEG|/people/rob.burbank/blog/2007/11/12/quickly-retrieving-fi-document-data-from-bseg]
Rob -
E-Mail Purchase Order - Text and PDF to include EKKO-EBELN
Hi All,
I am triggering purchase order layouts via E-mail. I want the e-mail subject line to have some static text whilst referencing the PO number (EKKO-EBELN).
I also want the PDF file to be called include the same text and reference number
How can I include EKKO-EBELN?
Is this something that I can simply add to the text line &ekko-ebeln& or do I have to build the rule into the processing program and entry form
Points will be rewarded
Cheers
SteveThe vendor e-mail address is picked up from the master data and the purchaser's e-mail would be picked up from their user account. The problem is that I don't know at what stage in the program SAPFM06P, used for sending the purchase order, I could set up the distribution list.
If I set the vendor address to name.address@somewhere; name2.address@somewhere else this works and both name and name2 receive the e-mail. But it would mean the purchasers ammending the vendor e-mail address each time, which just isn't practical.
I probably should have said that I'm using SAP version 46c and the e-mail is sent using standard SAP settings for 5-External send using program SAPFM06P and form MEDRUCK.
Thanks for the advice
Karen
Message was edited by: Karen Dean -
Field BSEG-EBELN does not exist on screen SAPMF05A 0302
Hi,
We are clearing vendor invoices with payments by creating Residual line item or posting into GL account.
Suppose if the vendor invoices are 1234-1 , 1234-2 ,1234-3 and payment is 1234-4 then we want to create residual item with PO as 1234-4DM or 1234-4CM if the diff is more.And if diff is less then we are posting into GL account with PO as above.
While posting the difference in amount into GL account, it is calling screen SAPMF05A/0300. In this screen we have option to enter PO number.But,
While creating residual line item, we have no option to enter PO document number on screen SAPMF05A/0302.
Please help me is there any way to get field BSEG-EBELN on screen SAPMF05A/0302.
Thanks,
Balakrishna.Thanks for your reply.
We are doing the same thing when posting into GL account and we have option to enter PO.
If PO key is automaticallly filled by the system what value shoud it take? In my case, it is filled it with last PO number of invoice or Payment which followed by DM( Debit Memo) or CM(Credit Memo) like 1234-4DM.
Please help me.
Thanks,
Balakrishna -
Link between table EKKO-EBELN and DMS - Document Management System
Hi to all,
I wanted to know the form to connect or link the Document Info Record (inside "Define Object Link") to object DRAW (DMS) with table EKKO-EBELN (order head). In standard form it is possible to do it with EKPO (Purchase order item) This is in transaction DC10 Define Object Link.
Thanks!
Greetings
MartinHi Martin,
Within table DRAD you can see all linked objects to a specific document info record (DIR).
To be able to link objects to DIRs you have to maintain the correct objects in customizing.
First of it is necessary to maintain the correct screen numbers for all needed objects within the customizing. Therefore go to transaction SPRO and select
Cross-Application Components
> Document Management
> Control Data
> Maintain Screen for Object Link
Here you can enter all needed SAP objects with the name and
the related screen number. If you do not know the object or the screen number you can display a list of all SAP standard objects in transaction SE80 under function group CV130 ("Screens").
So for material master you maintain the following entry:
SAP object Screen Description Auth.
MARA 201 material master 1
Please note that the system automatically adds the leading "1" which is displayed in function group CV130 under
"Screens". So for object MARA you just have to enter 201 instead of 1201.
The value "1" in the column "Auth." is necessary to grant that always the latest dynpros and authorizations were used when linking this object to an document info record. This will avoid different problems by displaying linked documents from the object side.
The next step is to decide which objects should be used in the different document types. Therefore please go to transaction DC10 and choose the relevant document type. Afterwards please select "Define object links". Here you can
add all needed objects only by entering the object. The correct screen number is taken automatically. Also note the blue information buttons in the upper right corner which contain further necessary information about the possible settings of the current screen.
After doing these settings in customizing you should be able to link the maintained objects to document info records and oppositely by using the DMS transaction CV02N (tab "object links") or the object related transactions.
Important notes regarding the object link functionalities are:
Note 880077: Performance problem using object links
Note 885977: Extension to note 867241 on object links
Note 926060: Extension of note 885977 for object link Purchase Order
Note 960202: Object Links Deleted While Adding New Objects
Note 1002648: Wrong behavior while using RFC_CHANGE_DOCUMENT_MASTER -
PO Output type with Option 5 External Send (&EKKO-EBELN&)
Dear Friends,
We have come across and interesting issue.
We want PO output to be send to vendor via email and the email subject should be "New Purchase Order <po document no>". To achieve this requirement we have set the Output type NEU --> Mail title and Text as NEW PURCHASE ORDER &EKKO-EBELN&.
When PO is created and before saving the PO user select the option 5 External Send in Message and further go to the communication tab. he can see the 'NEW PURCHASE ORDER &EKKO-EBELN&.' in Cover Page Text.
But the movement user saves the PO, Message --> communication is replaced with 'NEW PURCHASE ORDER".
And finally when the mail is sent with no PO document number and subject as "NEW PURCHASE ORDER".
Has any one has come across this issue before?
Or is there any OSS note for this?
Please Help!!
Sandeepdear sandeep
you can follow below mention steps or reffer OSS
1. You must maintain an e-mail address in the address in the vendor master.
2. The same applies to your own user master. You also have to specify an e-mail address there in order to identify the sender.
Note that it is not possible to change the e-mail address of the vendor via the SAP purchase order transaction (ME21N, ME22N, and so on). The system only uses the e-mail address of the vendor that is maintained in the vendor master!
3. For the output type for default values, a communication strategy needs to be maintained in the Customizing that supports the e-mail. You can find the definition of the communication strategy in the Customizing via the following path: (SPRO -> IMG -> SAP Web Application Server -> Basic Services -> Message Control -> Define Communication Strategy). As a default, communication strategy CS01 is delivered. This already contains the necessary entry for the external communication. Bear in mind that without a suitable communication strategy it is not possible to communicate with a partner via Medium 5 (external sending).
4. Use the standard SAP environment (program 'SAPFM06P', FORM routine 'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
5. In the condition records for the output type (for example, Transaction MN04), use medium '5' (External send).
6. You can use Transaction SCOT to trigger the output manually. The prerequisite for a correct sending is that the node is set correctly. This is not described here, but it must have already been carried out.
7. To be able to display, for example, the e-mail in Outlook, enter PDF as the format in the node.
For more details, check out the OSS note :191470
Hope this will help.
reward points if helpful
thanks and regards
ravikant dewangan -
Purchase order number EBELN in line items of g/l accounts FAGLL03
Hi,
nevertheless the purchase order is filled in the BSEG segment it does not appear in the fitting column in the line items of FAGLL03.
Does anyone know why and how to solve this?
Thank you,
TheresiaHI,
Please use transaction OBVU you already add fields BSEG-EBELN and BSEG-EBELP to the list of special fields.
Did you run program RFPOSXEXTEND and BALVBUFDEL after that ?
Then you should choose these fields in your line item display. Make sure that you are using the special fields and not the standard fields. The difference can be seen when you click with the right mouse button on the 'Change layout' screen when you
are adding or deleting fields. You can then choose the option 'Show technical field names' and choose the fields 1-U_EBELN, 1-U_EBELP.
Please can you also review the attached notes:
0207436 - Line items: unfilled fields / double special field
0320366 - Line items: display special field via menu path
0215798 - FBL*N: Special fields are not displayed
Hope this helps. Please Assign points if it useful.
Regards
Ravinagh Boni -
Is there another table besides BSEG to link EKBE PO# (EBELN) to the FI Logistics doc in BSAK (BELNR) for a data pull?
Our problem is EKBE contains Material Doc# and we need the FI/AP Logistics document which is in BSAK. We are using BSEG but it is so large the run time is days.
Thanks
Mary
Edited by: Mary Calaway on Jan 10, 2008 11:00 PMEKBE-BELNR (material document number) concatenated with EKBE-GJAHR (fiscal year) is matched wtih BKPF-AWKEY.
-
Dispalying ME23N w.r.t the EBELN
Hi Folks,
I am doing an interactive report where at the level of list 4 I have to call ME23N w.r.t the EBELN I had displayed in list 3.
loop at iekpo.
iekpo-ebeln hotspot on,
hide iekpo-ebeln.
endloop.
if sy-lsind = 4.
call transaction 'ME23N' and skip first screen( here I want to validate it with" where ebeln = iekpo-ebeln)
How to achieve that?
Thanks,
K.Kiran.
Message was edited by:
Kiran KDev,
Can you please let me know the syntax.
set parameter id EBN field iekpo-ebeln is sjowing an error.
K.Kiran
Message was edited by:
Kiran K -
Convert >_tnati-ebeln& - purchase order to 1234567890 - purchase order
Hi All,
I have got data from as below
DATA: lv_covtitle TYPE so_obj_des. " Cover text
SELECT SINGLE objdes
FROM tnati
INTO lv_covtitle
WHERE spras = nast-spras AND
kappl = nast-kappl AND
kschl = nast-kschl.
IF sy-subrc EQ 0.
Pass cover text to fp_outputparams
fp_outputparams-covtitle = lv_covtitle.
ENDIF.
Now in field value for field lv_covtitle is >_tnati-ebeln& - purchase order
and gt_tnati-ebeln = 1234567890 so 1234567890 - purchase order should be passed to parameter fp_outputparams-covtitle...
But its coming as >_tnati-ebeln& - purchase order in SOST transaction...
Please help me how can i convert lv_covtitle value before passing it to the parameter fp_outputparams-covtitle
thank you in advance...Hi Pawan
The field lv_covtitle contains the command to pass value to script >_tnati-ebeln& but not the value itself.
Why not perform a read table on gt_tnati then pass that value to fp_outputparams.
DATA: lv_covtitle TYPE so_obj_des. " Cover text
SELECT SINGLE objdes
FROM tnati
INTO lv_covtitle
WHERE spras = nast-spras AND
kappl = nast-kappl AND
kschl = nast-kschl.
IF sy-subrc EQ 0.
*read the table gt_tnati
read table GT_TNATI with table key <key> = <ref_para>.
fp_outputparams-covtitle = gt_tnati-ebeln.
ENDIF.
regards
Isaac Prince -
Add field 'ebeln' in selection-screen of FBL1N transaction
Hi Experts,
Is there a way to display the field 'ebeln' in transaction FBL1N for certain document types and company code only..?
I have already tried this steps below..But the problem is, this changes below is applicable to all document types.
1. Trans. SE36, indicate logical database KDF. <- Logical database for FBL1N transaction
2. Details > Selection views
3. Update the standard SAP view
4. Select table BSIK
5. Include field ebeln.
Regards,
EkitzvDear,
Please kindly note that field BSEG-EBELN is not possible for being shown
with a value in FBL1N (and FBL5N).
Since Release 3.0, several purchase orders can be offset in one invoice.
As a result, different purchasing document numbers (BSEG-EBELN) can be
contained in the different G/L account line items..
As a result, it is no longer possible to enter a unique purchasing
document number in the customer/vendor line item.Field BSEG-EBELN is not
filled in the vendor line item and therefore cannot be displayed in the
line item display for customers/vendors.
You could reference note 152335 to find a more detailed explanation and
possible solution of the issue.
It is only possible to view the purchase order number(EBELN) in FBL3N.
As a workaround, you may branch from vendor line item display to
'Document overview' and you will see the PO number for the respective
accounting document in other G/L account line items.
What You are doing is to insert the field EBELN into the Dynamic selection of the FBL1N but this does not mean to have it available into the FBL1N layout.
I hope the System behaviour is clerer.
Mauri -
Change Field in FB02 - (BSEG-EBELN)
Dear Experts,
Please advise whether this field BSEG-EBELN can be changed for a FI document in transaction code FB02.
Many thanks.Dear Mr. Parthiban,
EBELN is the Purchasing Document Number and it is Dirived in FI Through the MM Posting(FI-MM Integration) and It Cannot Be changed in FI Document
Best Regards,
Ravi Reddy
Maybe you are looking for
-
How can i drive 2 external displays with my macbook pro?
I just purchased an Macbook Pro and wanted to know if there is a solution to drive 2 external Apple Cinema Displays simultaeously. (Set up so displays operate as 1)?
-
Why are the updates so large?
And where does all that data go after 3 hours of downloading?
-
How to read and update Registry keys on Windows?
I nedd to be able to read registry as well as DACL to set permissions on WinNT File System. I did that in VB, but need to do it in Java. Any help would be appriciated.
-
I brought my 5s last year in Canada. And take back to China to use. few days ago, I found my camera can't focus and the picture is fuzzy . I had call to Apple's Chinese service for check and help. After they check, they said this is the hardware 's p
-
Itunes won't even start burning a CD, just cancels out
Oh please someone help! I knew I shouldn't have upgraded itunes, I'll never learn. Here is the diagnostic info... Thanks a ton! Microsoft Windows XP Home Edition Service Pack 2 (Build 2600) Gateway Gateway M520 iTunes 7.1.0.59 CD Driver 2.0.6.1 CD Dr