Here is a screenshot of part of the code in LV60A003 with billing block and billing status checks:
Go to SE11 and look what LIKP-FAKSK and VBUK-FKSTK means and what values they can have.
In general, sy-subrc different from zero means the check is not successful and that you cannot copy whatever you are trying to add in the document.
The perform statements here are just to manage the messages during document creation.
For VTLA - include FV50B101 (routine 101):
The developer even left comments in English where the checks are performed and what they do.
What is there that you have difficulty understanding?
If you are not comfortable with reading code, here is a hint: many ABAPers can be bribed with coffee, beer, snacks etc. and explain some of the basics to you, if you ask them nicely.
Still, if you are planning to work in the SD area, it is a good idea to check if your company organizes internal trainings for ABAP and sign up or start reading on your own - SD is userexit land and you need at least to be able to read and understand the code.



