Transaction: VL02N

Press enter to lock the delivery and enter in edit mode of the document.
You can create or change/display the output for this document by choosing from Menu: Extras -> Delivery Output -> Header

Sample delivery note output program RLE_DELNOTE. You can see how to define the ENTRY form routine which is called by the SAP output framework.
FORM ENTRY USING RETURN_CODE US_SCREEN. DATA: LF_RETCODE TYPE SY-SUBRC. XSCREEN = US_SCREEN. PERFORM PROCESSING USING US_SCREEN CHANGING LF_RETCODE. IF LF_RETCODE NE 0. RETURN_CODE = 1. ELSE. RETURN_CODE = 0. ENDIF. ENDFORM.
You will need some GLOBAL definitions and it is best to include the following:
INCLUDE rvadtabl.
Debugging output
Put a breakpoint in the output program and start manual processing of the output using program (SE38):
RSNAST00
How to return some info or error message in the Output log
Use a call to the following routine:
FORM PROTOCOL_UPDATE. CHECK XSCREEN = SPACE. CALL FUNCTION 'NAST_PROTOCOL_UPDATE' EXPORTING MSG_ARBGB = SYST-MSGID MSG_NR = SYST-MSGNO MSG_TY = SYST-MSGTY MSG_V1 = SYST-MSGV1 MSG_V2 = SYST-MSGV2 MSG_V3 = SYST-MSGV3 MSG_V4 = SYST-MSGV4 EXCEPTIONS OTHERS = 1. ENDFORM.
If you output error messages they will be kept in the output log for the user to analyse the reason for the failure of the output.
Output determination – Documentation
Other useful sites and articles
and how to debug output determination and execution:
http://sapknowledgebank.blogspot.com/2018/10/message-output-type-debugging.html
Generally the solution is to change from 4-Immediate output (via background task) to 1-with program and use RSNAST00. This can be achieved in Messages output changing Extras > Output > Header > Edit), click on the button ‘Further data’ and selecting “1”. Also put a breakpoint in output program and run RSNAST00 to start output manually in Dialog mode.
Send HTML email using template in ABAP
https://github.com/vidyadharg/ABAP-HTML-eMail
and “Creating QR code in ABAP” video: https://www.youtube.com/watch?v=DQdKnmon8II