How do you get multiple media objec text attachments from a UBE?

Ellen_Deak

Active Member
Hello List,

I'm using the Media Object system function to get text attachments for order
header and order lines. Everything works fine, as long as there is only
attachment on the order line. If there are two text attachments, I only get
the text from the first attachment. How do I get the text from the 2nd
attachment?

Thanks,

Ellen Deak
Senior Programmer/Analyst
Elkhart Products Corporation
B7333 SP 18.1 Rev 0
AS/400 V4R5M0

---------------------------------
Here's my ER:

RV vMediaText = ""
VA rpt_mnLengthOfMediaObj_MATH01 = 0
Media Objects(GT4211A, <Get Text>, RV vMediaText, BC Document (Order No,
Invoice, etc.) (F4211), BC Order Type (F4211), BC Order Company (Order
Number) (F4211), BC Line Number (F4211))
VA rpt_mnLengthOfMediaObj_MATH01 = length([RV vMediaText])
If VA rpt_mnLengthOfMediaObj_MATH01 is greater than <Zero>
VA rpt_mnLineNumber_LNID = [BC Line Number (F4211)]
Do Custom Section(RS CreateShipmentNotes)
End If
 
Hi Ellen,
I had the similar problem but when inserting the attachment to the A/R Detail File (F03B11). I was converting the data from the legacy system to JDE. I had to attach two text attachments. I was not able to find a way. All JDE offers throught that system function is to add only one attachment.
Hope one of them out there have done it and can share the thought.

Sriram.
OneWorld XE SP 18.1 AS/400.
 
Ellen,

You are doing perfectly, to grab the 4211 record's MO. Now do the same thing for the 4201 record's MO. This, of course, is assuming that the second record you want is the Header record. If you were trying to get a second MO for the detail line, then most likely you need to find what MO is being used to store the second line.

And yes, it is possible to have virtually unlimited MO texts for a single record - you just have to 'key' for it!

Ben again
 
Ellen,

I know that you already got a lot of answer but I seem to understand the question differently that the other. You want to get the second media object text for one line of detail, that mean using the "Same key/ same line number for the same order" ?

If the answer is YES, sorry I do not have any answer but I tried it and I'm also not able to get it using JDE business function. I have a similar need and I hope somebody can help. The only thing that I can say about second text using the same key is that they are store in a text file rather than the F00165.

Please clarify if I understood your question wrong.

Christian Audet
 
Here is the answer from Ellen :
===================================================================

Yes. In my scenario Order 1, Line 1 has two text media objects attached to
it. I want to get the text from the 2nd media object as well as the first.

Ellen Deak
Senior Programmer/Analyst
Elkhart Products Corporation
574.264.3181 x282
 
Ok, Ok I am blushing from embarrassment now. Can I start over? You sure? Ok, here goes......

For B7333 JDE has added functionality to add multiple media object attachements to your, uh, let's say Sales Order. The first text object goes into the TXVC field directly (yeah it's surrounded by massive formatting), and all subsequent text objects get thrown into .txt files somewhere on your system. Unfortunately, JDEdwards does not support retrieval of the 'extra' objects at this time, so we have to do it on our own. Now these .txt filenames are also thrown into the TXVC field somewhere beyond the first text object. Now you can tell how many text objects there are (well it's not scientific) by taking the FUTL field and dividing by 61.

I know, I know it's getting a little deep. So now you know the text file names, and you can look @ P98MOQUE application to find where those files are located. If you are in the application - the ones you should be concerned with are the TYPE = '03' queues. The queue path then gives you the directory for where the files are stored. The queue name is also stored in the TXVC field, so if you have more than one queue setup for text - you can still find your text.

The upshot is - it is going to take some time to actually be able to retrieve the added text lines - so why not try something a little easier.

Before B7333 - the way to get multiple text objects was to create a Media Object Data Structure that looks like the Data Structure you wish to mimic, say Sales Order, with DOCO, KCOO, DCTO, and add another field UKID than can be used as a counting number. Then when you want the MO text you use the MO Structures function to retrieve a media object text with the added counting number. This is quite easy to code (once you get the concept) and deciding how you will handle the counting number will be the more difficult part. with this design approach, you can have multiple text objects and still use the <Get Text> function for reporting.

Ben again
 
Hi Ben,
I have seen multiple media objec text attachments on the location defined in P98MOQUE like TXT-30173985-6BEB-4566-9DC5-A99AE9C6E1BE.txt TXT-245AFF8A-0A66-40D9-9DF5-099BCBF65C7E.txt
How do we link them back to the work order.
When I try to retrieve text from f00165 I am getting only upto 1st attachment.
Please advice


Thanks
SP
 
Hi,
I tried this out. Yes, the system function retrieves only the first media obj attachment. To retrieve the 2nd and rest, I wrote a C BSFN which had the API GetGeneric Text. Here's the code :
JDBReturn = jdeGTGet_GenericText(_J("GT4301"), &dsF4301TextKey, lpDS->nMediaObjectSequenceNumber, &pMOData, &lTotalRec);
if (JDBReturn == JDEDB_PASSED)
{

jdeStrncpy ((JCHAR *)lpDS->szMediaObjectText, (const JCHAR *)(pMOData->pData), DIM(lpDS->szMediaObjectText)-1);
}

Initially set the mediaobjseq no to 2 and then keep incrementing it till there are records in F00162.
Hope this helps

Thanks,
Subbu
 
Hey Allen,

Batch program does not print multi-line media text attachments if Section Property (for the section containing Report Variable printing tect attachment) for Absolute Position is selected. It will print multiple lines after not selecting absolute position property.

Hope this helps.

Thanks,
Amol
 
Back
Top