6 Replies Latest reply: Feb 19, 2013 7:06 AM by 979471 RSS

    Methods to return a value from Banner DAL to a variable in Transaction o/p

    979471
      I am looking for methods to return a value of a BANNER DAL to variable in the output of a transaction.

      Currently i have created a Banner post transcation DAL and i want to return the value obtained by processing the DAL to variable already present in the transcation output.

      I tried the Setfld rule and was not able to return the value to the variable.

      Could anyone help me with this please.
        • 1. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
          User9976634-Oracle
          It is not clear what you are trying to accomplish. Perhaps you could provide a more detailed description of your goal.

          For instance, you mention the "...Banner post transaction DAL...". Are you referring to a PostTransDAL rule defined in the AFGJOB for a given GenData run? Or are you talking about a DAL script called during Banner processing for a transaction or a batch - which occurs during the Print operation?

          When you say "...return the value obtained..." where are you trying to send that value? Are you actually trying to print it in a document field? Or are you trying to store the data in a GVM associated with the transaction batch record? Or some place else?

          Is the value to be retained in a field in the document files for later storage/archival, reprint, or sending the transaction to WIP for manual editing?

          I will tell you that for the most part, anything that you are doing during the actual print operation is typically transient. By Print time the system has already written the data files for the document as well as the transactional record information for the batch. So if you are not attempting to simply print a value on the document and instead expect to retain this value in storage, then you may have to move your process earlier in the job generation than Banner processing.
          • 2. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
            979471
            Hi,

            Yes i am talking about a DAL script called during Banner processing for a transaction which occurs during the Print operation.

            I am looking for methods to print the ouput in physical prints and need not store the value.

            The output of the DAL is required to be passed to an already existing variable in all pages of my output. Please find my sample banner DAL below.

            BeginSub PreBatch
            #tran = 0
            EndSub

            BeginSub PstTrans
            #tran += 1
            rname = RecipName()
            if (rname = "INSU")
            #RcID = "0001"
            else
            #RcID = "0002"
            #Pagecnt = TOTALSHEETS()
            #pageno = 1
            while(#Pagecnt >= #pageno)
            if (HaveImage ("NYFTZAA"))
            Barcode = "*" & #RcID & "." & #tran & "." & #Pagecnt & "." & #pageno & "*"
            SetFld(Barcode,"NYFTZ\" & #pageno,"*","*")
            #pageno += 1
            end
            Wend
            EndSub

            note:- "NYFTZ" is the variable present in the image "NYFTZAA" which is my common image present in all pages of my output added via a PostTransDAL thru AFGJOB.JDT

            Once i am able to pass the result of above DAL to variables in my output, i will change properties of variable to Barcode and print the same in all pages of my physical prints as it will used for automated mail grouping operation only and i wouldnt need to store the same any where.

            Thanks in advance for your much valuable help.
            • 3. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
              User9976634-Oracle
              I'm going to guess that part of the problem is the While loop doing a HaveImage() but you don't increment which section you are addressing. If you only need to know the section exists once, then perhaps do the HaveImage check outside the loop. If you do need to check multiples, then you would append an index similar to how you are doing in your SetFld call.

              I do have to point out that your HaveImage() check is not looking at the same section you are trying to set the field onto. I don't know whether that is relevant.

              Finally, when trying to address certain objects the search is often narrow and you may need to broaden it. You do this by adding an asterisk parameter (in quotes) at various levels.

              For instance, if you want to ensure you are searching the entire document set, you would need to so something like this:

              HAVEImage("MyImage", , "*")

              You will notice the missing form parameter. You would not specify a form if you are searching the entire document. This essentially says to find "MyImage" on any form in any Forms List (Group) in the transaction.

              The same may be necessary on the SetFld() parameter when trying to assign data as you move across the entire document.

              Edited by: user9976634 on Feb 14, 2013 6:12 PM
              • 4. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
                979471
                Hi, Thank you so much for your inputs.

                I tried the below mentioned suggestions in my DAL. Please find the updated DAL below.

                BeginSub PreBatch
                #tran = 0
                EndSub

                BeginSub PstTrans
                #tran += 1
                rname = RecipName()
                if (rname = "INSU")
                #RcID = "0001"
                else
                #RcID = "0002"
                #Pagecnt = TOTALSHEETS()
                #pageno = 1
                if (HaveImage ("NYFTZAA","*","*"))
                while(#Pagecnt >= #pageno)
                Barcode = "*" & "#RcID" & "." & #tran & "." & #Pagecnt & "." & #pageno & "*"
                SetFld(Barcode,"NYFTZ\" & #pageno,"*","*")
                #pageno += 1
                Wend
                end
                end
                EndSub

                But still i am not able to get my value in physical prints... Awaiting for your valuable inputs on the same issue.
                • 5. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
                  User9976634-Oracle
                  I'm going to guess you meant to end the first IF statement before the second one begins?
                  Otherwise you only fall into your While loop during the else condition. In fact, you probably mean to end it before the call to TotalSheets() otherwise, you would be missing a couple of values that you are using in the assignment.

                  As a debugging aid you might want to sprinkle in some PRINT_IT() statements at a few points. This will write your messages into the trace log and can be checked after a run to see that you are getting values that you might expect.

                  For instance, SETFLD() actually returns a value that you can capture.

                  nResult = SetFld(.......)

                  PRINT_IT("SetFld Returns " & nResult);
                  (Or if you would rather, you can write it into the regular LogFile using RPLogMsg(). Your call.)

                  Be sure to remove the message prints once you are sure of your results.
                  • 6. Re: Methods to return a value from Banner DAL to a variable in Transaction o/p
                    979471
                    Thank you so much for your valuable help. I tried debugging my DAL using Print_IT function and was able to find that the problem is with the Setfld function as it is the only stuff that is returning a false value unlike all other calcs returning expected results.

                    Please find my Updated DAL based on your previous post, below.

                    BeginSub PreBatch
                    #tran = 0
                    EndSub

                    BeginSub PstTrans
                    #tran += 1
                    rname = RecipBatch()
                    if (rname = "RBROK")
                    #RcID = "0001"
                    else
                    #RcID = "0002"
                    end
                    #Pagecnt = TOTALSHEETS()
                    #pageno = 1
                    if (HAVEImage ("NYFTZAA",,"*"))
                    while(#Pagecnt >= #pageno)
                    qName = "NYFTZAA"
                    qName = qName & "\" & #pageno
                    Barcode = "*" & #RcID & "." & #tran & "." & #Pagecnt & "." & #pageno & "*"
                    nresult = SetFld(Barcode,"NYFTZ",qName,,"*")
                    PRINT_IT("SetFld Returns " & qName & Barcode & nresult)
                    #pageno += 1
                    Wend
                    end


                    Please help me with the Setfld funtion or any other equivalent alternative which would pass my value residing in variable "Barcode" to the field present in my form.

                    Thank you so much for your help without which i wouldn't have come this FAR.