on 12-09-2015 1:22 PM
Olá pessoal,
Gostaria de tirar uma dúvida sobre o preenchimento do grupo de tag <lacres>, este grupo de tag fica dentro do grupo <vol>, que por sua vez fica abaixo do grupo <transp>, conforme abaixo:
O cliente solicita que os lacres sejam todos informados dentro do grupo <lacres>, por exemplo:
<lacres>
<nLacre>12121</nLacre>
<nLacre>23232</nLacre>
</lacres>
e não que seja aberto um novo grupo <vol> para cada lacre. O problema é que a tabela OUT_VOLUME (método FILL_HEADER) não possui uma estrutura/tabela para o campo T4_NLACRE e desta forma eu não consigo apendar vários lacres para o mesmo grupo de volumes.
Procurei por notas sap e tópicos aqui no SCN, mas acabei não encontrando muitas coisas sobre isto.
Alguém já precisou preencher estas tags desta forma?
Att,
Alan Oliveira
Boa tarde Alan,
Conseguiu resolver o problema?
[]'s
JN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Boa tarde pessoal,
Alguém com o problema acima?
Att,
Alan Oliveira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alan,
O standard SAP não contempla o preenchimento dessa forma. Vide o form MAP_XMLH (Include LJ_1B_NFEF72 -- procure pelo numero da nota 2083666). Acredito que abrir um chamado seja a melhor saída.
Em paralelo, você pode fazer um workaround usando o método FILL_AUTXML das BAdI's (seja a nova ou a antiga).
Esse código dá uma idéia do que você pode fazer para gerar as tags conforme você deseja:
FIELD-SYMBOLS: <gt_rfc_vol> TYPE j_1bnfe_t_rfc_vol,
<gt_rfc_text> TYPE j_1bnfe_t_rfc_text,
<ls_rfc_vol> TYPE j_1bnfe_s_rfc_vol,
<ls_rfc_text> TYPE j_1bnfe_s_rfc_text.
DATA: ls_rfc_text TYPE j_1bnfe_s_rfc_text,
lt_lacre TYPE STANDARD TABLE OF j_1bnfe_rfc_text,
lv_lacre TYPE j_1bnfe_rfc_text.
ASSIGN ('(SAPLJ_1B_NFE)GT_RFC_VOL') TO <gt_rfc_vol>.
ASSIGN ('(SAPLJ_1B_NFE)GT_RFC_TEXT') TO <gt_rfc_text>.
IF <gt_rfc_vol> IS ASSIGNED AND <gt_rfc_text> IS ASSIGNED.
LOOP AT <gt_rfc_vol> ASSIGNING <ls_rfc_vol>.
IF <ls_rfc_vol>-text_id_lacres IS NOT INITIAL.
READ TABLE <gt_rfc_text> ASSIGNING <ls_rfc_text>
WITH KEY id = <ls_rfc_vol>-text_id_lacres.
IF <ls_rfc_text> IS ASSIGNED.
"Levando em conta que os numeros dos lacres virão separados por virgula
"e em um unico registro...
SPLIT <ls_rfc_text>-text AT ',' INTO TABLE lt_lacre.
"Para cada lacre, adicionar uma nova entrada na tabela GT_RFC_TEXT
LOOP AT lt_lacre INTO lv_lacre.
IF sy-tabix = 1.
"Altera o primeiro registro da tabela GT_RFC_TEXT com o valor do primeiro lacre
<ls_rfc_text>-text = lv_lacre.
ls_rfc_text-seq_no = <ls_rfc_text>-seq_no.
ELSE.
ls_rfc_text-id = <ls_rfc_vol>-text_id_lacres.
ls_rfc_text-seq_no = ls_rfc_text-seq_no + 1.
ls_rfc_text-text = lv_lacre.
APPEND ls_rfc_text TO <gt_rfc_text>.
ENDIF.
ENDLOOP.
CLEAR ls_rfc_text.
ENDIF.
UNASSIGN <ls_rfc_text>.
ENDIF.
ENDLOOP.
ENDIF.
E o resultado:
[]'s
JN
User | Count |
---|---|
10 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.