Skip to main content

UFFE file naming

Answered

Comments

4 comments

  • Official comment
    Thomas

    Hi John,

    Yes, you can create the directory and the file name with SQL: -syntax.

    For example to get the timestamp put this in the output file name:

    SQL:SELECT 'C:\Invoice_'+ REPLACE(CONVERT(VARCHAR(10), GETDATE(), 101), '/', '') +'_DocKey@.xml'

    In HANA, this syntax is (Thanks Tim Verholt):

    SQL:SELECT 'C:\Invoice_'  || TO_VARCHAR(NOW(), 'yyyyMMdd') || '_DocKey@.xml'

    This would give you C:\Invoice_08032016-241.xml as the output name.

    -Thomas

  • John Cobby

    Awesome! Thanks a lot Thomas

    Regards,

    John

  • John Cobby

    Hi,

     

    Could I please add on an additional question? Could you help me with the SQL for the validation?

    I want it to check if the field U_DestType in OCRD contains the values of 1, 2 or 6 before processing the UFFE for that record.

    I have tried the below code in SQL Manager and it works but for some reason it's not giving the expected results when applied in the validation.

    IF (SELECT T0.U_DestType FROM OCRD T0 INNER JOIN ODLN T1 ON T1.CardCode = T0.CardCode WHERE T1.DocEntry = 'DocKey@') NOT IN ('1','2','6')

    BEGIN
    SELECT 'SHOW_ERROR' FOR BROWSE
    END

     

    Thanks again,

    John

  • Thomas

    Hi John,

    Can't see anything wrong there, you could try without the single quotes in dockey and the numbers.

    -Thomas

Please sign in to leave a comment.