‎2007 Mar 26 3:01 PM
Hi,
Have somebody any example code updating NAST table?
I have found in forum multiples results but there are not consensus in what FM you must use.
I have found
WFMC_MESSAGE_SINGLE
RV_MESSAGE_INSERT
NAST_SAVE_OBJECT
thx
‎2007 Mar 26 3:06 PM
Hi,
Nast table holds the output types to be processed.
1) Hence any new document is created which is required to be processed by an output type, the entry automatically inserted into the NAST table.
2) If the existing document is reprocessed, again entry goes into the NAST table.
This is how nast table updates.
Regards,
Shahu
‎2007 Mar 26 3:13 PM
Hi,
Please try this FM RV_MESSAGE_UPDATE_SINGLE to update table NAST.
Regards,
Ferry Lianto
‎2007 Mar 26 3:15 PM
I think you only have read the title of the post but not the content.
I need update manually the table
Thx in any case.
‎2007 Mar 26 3:18 PM
Hi Manel,
<b>RV_MESSAGE_UPDATE_SINGLE</b> function module will INSERT an entry to NAST table and You can give the requiered values to the structure <b>MSG_NAST</b>(Importing parameters).
Thanks,
Vinay
‎2007 Mar 26 3:27 PM
ok, thx.
Seeing the code probably it will be satisfactory.
NAST = MSG_NAST.
UPDATE NAST.
IF SY-SUBRC NE 0.
INSERT NAST.
IF SY-SUBRC NE 0.
MESSAGE A013 WITH NAST-KAPPL NAST-OBJKY.
ENDIF.
ENDIF.
Do you have any example filling import strcuture?
Thx
‎2024 Sep 19 4:00 PM
Use this code for updating NAST from custom program
* Data Declaration
DATA: ls_nast TYPE nast,
lv_msg_doc TYPE char50,
lv_vbeln TYPE vbeln_vl.
* Constants
CONSTANTS: lc_v2 TYPE char2 VALUE 'V2',
lc_nacha TYPE char1 VALUE '6',
lc_vsztp TYPE char1 VALUE '4',
lc_zld2 TYPE char4 VALUE 'ZLD2',
lc_01 TYPE na_anzal VALUE '01',
lc_vstat TYPE na_vstat VALUE '1',
lc_msid TYPE sy-msgid VALUE 'E0',
lc_msgno TYPE sy-msgno VALUE '045'.
* Clear
CLEAR: ls_nast, lv_msg_doc, lv_vbeln.
* Logic to update NAST for all deliveries
LOOP AT p_li_docid INTO DATA(ls_docid).
lv_vbeln = ls_docid-docno+25(10).
lv_msg_doc = lv_docnum.
CALL FUNCTION 'NAST_PROTOCOL_INITIALIZE'.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = lc_msid
msg_nr = lc_msgno
msg_ty = lc_s
msg_v1 = lv_msg_doc.
CALL FUNCTION 'NAST_PROTOCOL_STORE' ##FM_SUBRC_OK
IMPORTING
msg_cmfpnr = ls_nast-cmfpnr
EXCEPTIONS
no_protocol_update = 1
OTHERS = 2.
ls_nast-spras = sy-langu.
ls_nast-anzal = lc_01.
ls_nast-vstat = lc_vstat. "'1'.
ls_nast-usnam = sy-uname.
ls_nast-kappl = lc_v2.
ls_nast-objky = lv_vbeln.
ls_nast-kschl = lc_zld2.
ls_nast-parnr = p_ls_cust-kunnr.
ls_nast-parvw = lc_we.
ls_nast-erdat = sy-datum.
ls_nast-eruhr = sy-uzeit.
ls_nast-nacha = lc_nacha.
ls_nast-vsztp = lc_vsztp.
ls_nast-manue = abap_true.
ls_nast-datvr = sy-datum.
ls_nast-uhrvr = sy-uzeit.
CALL FUNCTION 'RV_MESSAGE_UPDATE_SINGLE'
EXPORTING
msg_nast = ls_nast.
CLEAR: ls_docid, ls_nast.
ENDLOOP.